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
Gwenaël Samain
cython
Commits
86cca573
Commit
86cca573
authored
May 18, 2018
by
gabrieldemarmiesse
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed formatting of existing note and transfered one from the reference/extension_types.rst.
parent
353299cb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
5 deletions
+16
-5
docs/src/userguide/special_methods.rst
docs/src/userguide/special_methods.rst
+16
-5
No files found.
docs/src/userguide/special_methods.rst
View file @
86cca573
...
@@ -71,11 +71,22 @@ your :meth:`__cinit__`` method to take no arguments (other than self) it
...
@@ -71,11 +71,22 @@ your :meth:`__cinit__`` method to take no arguments (other than self) it
will simply ignore any extra arguments passed to the constructor without
will simply ignore any extra arguments passed to the constructor without
complaining about the signature mismatch.
complaining about the signature mismatch.
.. Note: Older Cython files may use :meth:`__new__` rather than :meth:`__cinit__`. The two are synonyms.
.. Note::
The name change from :meth:`__new__` to :meth:`__cinit__` was to avoid
confusion with Python :meth:`__new__` (which is an entirely different
Older Cython files may use :meth:`__new__` rather than :meth:`__cinit__`. The two are synonyms.
concept) and eventually the use of :meth:`__new__` in Cython will be
The name change from :meth:`__new__` to :meth:`__cinit__` was to avoid
disallowed to pave the way for supporting Python-style :meth:`__new__`
confusion with Python :meth:`__new__` (which is an entirely different
concept) and eventually the use of :meth:`__new__` in Cython will be
disallowed to pave the way for supporting Python-style :meth:`__new__`
.. Note::
All constructor arguments will be passed as Python objects.
This implies that non-convertible C types such as pointers or C++ objects
cannot be passed into the constructor from Cython code. If this is needed,
use a factory function instead that handles the object initialisation.
It often helps to directly call ``__new__()`` in this function to bypass the
call to the ``__init__()`` constructor.
.. [#] http://docs.python.org/reference/datamodel.html#object.__new__
.. [#] http://docs.python.org/reference/datamodel.html#object.__new__
...
...
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