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
Xavier Thompson
cython
Commits
db43b8c0
Commit
db43b8c0
authored
6 years ago
by
scoder
Committed by
GitHub
6 years ago
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2424 from gabrieldemarmiesse/failing_test
Adding tests for "pure python mode" part 13
parents
ca66b709
3e94f893
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 @
db43b8c0
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
This diff is collapsed.
Click to expand it.
docs/src/tutorial/pure.rst
View file @
db43b8c0
...
...
@@ -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):
...
...
This diff is collapsed.
Click to expand it.
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