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
e3402907
Commit
e3402907
authored
May 30, 2014
by
Julien Delafontaine
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rewrote the 'Pure Python mode' tutorial and moved the 'Types' chapter to 'Language basics'.
parent
913d9a19
Changes
2
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
180 additions
and
105 deletions
+180
-105
docs/src/tutorial/pure.rst
docs/src/tutorial/pure.rst
+139
-88
docs/src/userguide/language_basics.rst
docs/src/userguide/language_basics.rst
+41
-17
No files found.
docs/src/tutorial/pure.rst
View file @
e3402907
This diff is collapsed.
Click to expand it.
docs/src/userguide/language_basics.rst
View file @
e3402907
...
...
@@ -64,6 +64,30 @@ an anonymous :keyword:`enum` declaration for this purpose, for example,::
ctypedef int* IntPtr
Types
-----
There are numerous types built in to the Cython module. One has all the
standard C types, namely ``char``, ``short``, ``int``, ``long``, ``longlong``
as well as their unsigned versions ``uchar``, ``ushort``, ``uint``, ``ulong``,
``ulonglong``. One also has ``bint`` and ``Py_ssize_t``.
For each type, there are pointer types ``p_int``, ``pp_int``, . . ., up to
three levels deep in interpreted mode, and infinitely deep in compiled mode.
The Python types int, long and bool are interpreted as C ``int``, ``long``
and ``bint`` respectively.
Also, the Python types ``list``, ``dict``, ``tuple``, . . . may
be used, as well as any user defined types. However at the moment they add very
few in terms of optimization to a simple ``object`` typing.
Pointer types may be constructed with ``cython.pointer(cython.int)``, and
arrays as ``cython.int[10]``. A limited attempt is made to emulate these more
complex types, but only so much can be done from the Python language.
Grouping multiple C declarations
--------------------------------
...
...
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