Commit db43b8c0 authored by scoder's avatar scoder Committed by GitHub

Merge pull request #2424 from gabrieldemarmiesse/failing_test

Adding tests for "pure python mode" part 13
parents ca66b709 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
......@@ -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):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment