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
Kirill Smelkov
cython
Commits
58dc19ba
Commit
58dc19ba
authored
May 17, 2018
by
scoder
Committed by
GitHub
May 17, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2275 from gabrieldemarmiesse/replace_text_with_links
Replace text with links
parents
6ffbfc5e
553822b5
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
54 additions
and
701 deletions
+54
-701
docs/src/reference/language_basics.rst
docs/src/reference/language_basics.rst
+22
-700
docs/src/userguide/language_basics.rst
docs/src/userguide/language_basics.rst
+32
-1
No files found.
docs/src/reference/language_basics.rst
View file @
58dc19ba
This diff is collapsed.
Click to expand it.
docs/src/userguide/language_basics.rst
View file @
58dc19ba
...
...
@@ -11,6 +11,7 @@
Language Basics
*****************
.. _declaring_data_types:
Declaring Data Types
====================
...
...
@@ -38,6 +39,8 @@ the use of ‘early binding’ programming techniques.
check that the type of some object matches the declared type.
.. _c_variable_and_type_definitions:
C variable and type definitions
===============================
...
...
@@ -135,6 +138,9 @@ Here is a simple example::
You can read more about them in :ref:`extension-types`.
.. _typing_types:
.. _types:
Types
-----
...
...
@@ -199,7 +205,8 @@ can group them into a :keyword:`cdef` block like this::
void f(Spam *s):
print s.tons, "Tons of spam"
.. _cpdef:
.. _cdef:
.. _python_functions_vs_c_functions:
Python functions vs. C functions
...
...
@@ -302,6 +309,8 @@ In the interests of clarity, it is probably a good idea to always be explicit
about object parameters in C functions.
.. _optional_arguments:
Optional Arguments
------------------
...
...
@@ -351,6 +360,8 @@ There may be a slight performance penalty when the optional arg is overridden
with one that does not have default values.
.. _keyword_only_argument:
Keyword-only Arguments
----------------------
...
...
@@ -380,6 +391,15 @@ terminate the list of positional arguments::
Shown above, the signature takes exactly two positional
parameters and has two required keyword parameters
Function Pointers
-----------------
Functions declared in a ``struct`` are automatically converted to function pointers.
For using error return values with function pointers, see the note at the bottom
of :ref:`error_return_values`.
.. _error_return_values:
Error return values
-------------------
...
...
@@ -453,6 +473,9 @@ Some things to note:
return type implicitly returns a Python object. (Exceptions on such functions
are implicitly propagated by returning NULL.)
.. _checking_return_values_of_non_cython_functions:
Checking return values of non-Cython functions
----------------------------------------------
...
...
@@ -474,6 +497,7 @@ return value and raise it yourself, for example,::
if p == NULL:
raise SpamError("Couldn't open the spam file")
.. _overriding_in_extension_types:
Overriding in extension types
-----------------------------
...
...
@@ -595,6 +619,7 @@ Sometimes Cython will complain unnecessarily, and sometimes it will fail to
detect a problem that exists. Ultimately, you need to understand the issue and
be careful what you do.
.. _type_casting:
Type Casting
------------
...
...
@@ -642,6 +667,8 @@ Here is an example::
The precedence of ``<...>`` is such that ``<type>a.b.c`` is interpreted as ``<type>(a.b.c)``.
.. _checked_type_casts:
Checked Type Casts
------------------
...
...
@@ -654,6 +681,7 @@ if ``x`` is not an instance of ``MyExtensionType``.
This tests for the exact class for builtin types,
but allows subclasses for :ref:`extension-types`.
.. _statements_and_expressions:
Statements and expressions
==========================
...
...
@@ -701,6 +729,7 @@ variable residing in the scope where it is assigned. The type of the variable
depends on type inference, except for the global module scope, where it is
always a Python object.
.. _built_in_functions:
Built-in Functions
------------------
...
...
@@ -811,6 +840,7 @@ Some things to note about the for-from loop:
Like other Python looping statements, break and continue may be used in the
body, and the loop may have an else clause.
.. _cython_file_types:
Cython file types
=================
...
...
@@ -909,6 +939,7 @@ of functions or class bodies.
separate parts that may be more appropriate in many cases. See
:ref:`sharing-declarations`.
.. _conditional_compilation:
Conditional Compilation
=======================
...
...
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