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
296a297b
Commit
296a297b
authored
Jun 22, 2018
by
scoder
Committed by
GitHub
Jun 22, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2398 from gabrieldemarmiesse/test_extension_types_2
Added tests to "Extension types" part 2
parents
3d61a95d
e5cbf651
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 @
296a297b
cdef
class
Shrubbery
:
cdef
public
int
width
,
height
cdef
readonly
float
depth
docs/src/userguide/extension_types.rst
View file @
296a297b
...
...
@@ -48,11 +48,9 @@ first method, but Cython code can use either method.
By default, extension type attributes are only accessible by direct access,
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
:keyword:`public` or :keyword:`readonly`. For example:
:
:keyword:`public` or :keyword:`readonly`. For example:
cdef class Shrubbery:
cdef public int width, height
cdef readonly float depth
.. literalinclude:: ../../examples/userguide/extension_types/python_access.pyx
makes the width and height attributes readable and writable from Python code,
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