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
Boxiang Sun
cython
Commits
3e94f893
Commit
3e94f893
authored
Jun 26, 2018
by
gabrieldemarmiesse
Committed by
gabrieldemarmiesse
Aug 11, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed an example in the documentation.
parent
084a25f5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
8 deletions
+19
-8
docs/examples/tutorial/pure/cclass.py
docs/examples/tutorial/pure/cclass.py
+16
-0
docs/src/tutorial/pure.rst
docs/src/tutorial/pure.rst
+3
-8
No files found.
docs/examples/tutorial/pure/cclass.py
0 → 100644
View file @
3e94f893
import
cython
@
cython
.
cclass
class
A
:
cython
.
declare
(
a
=
cython
.
int
,
b
=
cython
.
int
)
c
=
cython
.
declare
(
cython
.
int
,
visibility
=
'public'
)
d
=
cython
.
declare
(
cython
.
int
)
# private by default.
e
=
cython
.
declare
(
cython
.
int
,
visibility
=
'readonly'
)
def
__init__
(
self
,
a
,
b
,
c
,
d
=
5
,
e
=
3
):
self
.
a
=
a
self
.
b
=
b
self
.
c
=
c
self
.
d
=
d
self
.
e
=
e
docs/src/tutorial/pure.rst
View file @
3e94f893
...
...
@@ -130,14 +130,9 @@ Static typing
.. literalinclude:: ../../examples/tutorial/pure/cython_declare2.py
It can also be used to define extension type private, readonly and public attributes::
@cython.cclass
class A:
cython.declare(a=cython.int, b=cython.int)
c = cython.declare(cython.int, visibility='public')
d = cython.declare(cython.int, 5) # private by default.
e = cython.declare(cython.int, 5, visibility='readonly')
It can also be used to define extension type private, readonly and public attributes:
.. literalinclude:: ../../examples/tutorial/pure/cclass.py
* ``@cython.locals`` is a decorator that is used to specify the types of local
variables in the function body (including the arguments):
...
...
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