Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
cython
Commits
0562dde8
Commit
0562dde8
authored
Jun 25, 2018
by
gabrieldemarmiesse
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moved an example of language_basics.rst into the examples directory for testing.
parent
084a25f5
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
14 deletions
+15
-14
docs/examples/userguide/language_basics/override.pyx
docs/examples/userguide/language_basics/override.pyx
+13
-0
docs/src/userguide/language_basics.rst
docs/src/userguide/language_basics.rst
+2
-14
No files found.
docs/examples/userguide/language_basics/override.pyx
0 → 100644
View file @
0562dde8
from
__future__
import
print_function
cdef
class
A
:
cdef
foo
(
self
):
print
(
"A"
)
cdef
class
B
(
A
):
cpdef
foo
(
self
):
print
(
"B"
)
class
C
(
B
):
# NOTE: not cdef class
def
foo
(
self
):
print
(
"C"
)
docs/src/userguide/language_basics.rst
View file @
0562dde8
...
...
@@ -510,21 +510,9 @@ Overriding in extension types
When subclassing an extension type with a Python class,
``def`` methods can override ``cpdef`` methods but not ``cdef``
methods:
:
methods:
from __future__ import print_function
cdef class A:
cdef foo(self):
print("A")
cdef class B(A):
cpdef foo(self):
print("B")
class C(B): # NOTE: not cdef class
def foo(self):
print("C")
.. literalinclude:: ../../examples/userguide/language_basics/override.pyx
If ``C`` above would be an extension type (``cdef class``),
this would not work correctly.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment