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
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cython
Commits
e5cbf651
Commit
e5cbf651
authored
Jun 22, 2018
by
gabrieldemarmiesse
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moved an example from extension_types.rst to the examples directory.
parent
b9f7a142
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
4 deletions
+5
-4
docs/examples/userguide/extension_types/python_access.pyx
docs/examples/userguide/extension_types/python_access.pyx
+3
-0
docs/src/userguide/extension_types.rst
docs/src/userguide/extension_types.rst
+2
-4
No files found.
docs/examples/userguide/extension_types/python_access.pyx
0 → 100644
View file @
e5cbf651
cdef
class
Shrubbery
:
cdef
public
int
width
,
height
cdef
readonly
float
depth
docs/src/userguide/extension_types.rst
View file @
e5cbf651
...
@@ -48,11 +48,9 @@ first method, but Cython code can use either method.
...
@@ -48,11 +48,9 @@ first method, but Cython code can use either method.
By default, extension type attributes are only accessible by direct access,
By default, extension type attributes are only accessible by direct access,
not Python access, which means that they are not accessible from Python code.
not Python access, which means that they are not accessible from Python code.
To make them accessible from Python code, you need to declare them as
To make them accessible from Python code, you need to declare them as
:keyword:`public` or :keyword:`readonly`. For example:
:
:keyword:`public` or :keyword:`readonly`. For example:
cdef class Shrubbery:
.. literalinclude:: ../../examples/userguide/extension_types/python_access.pyx
cdef public int width, height
cdef readonly float depth
makes the width and height attributes readable and writable from Python code,
makes the width and height attributes readable and writable from Python code,
and the depth attribute readable but not writable.
and the depth attribute readable but not writable.
...
...
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