Commit 3a323e22 authored by Robert Bradshaw's avatar Robert Bradshaw Committed by GitHub

Merge pull request #2623 from nicktimko/patch-1

Call out the different name used for the wrapper
parents c24b62b1 d4ac4e33
...@@ -111,7 +111,12 @@ of the :func:`cythonize` function. ...@@ -111,7 +111,12 @@ of the :func:`cythonize` function.
Declare a var with the wrapped C++ class Declare a var with the wrapped C++ class
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Now, we use cdef to declare a var of the class with the C++ ``new`` statement: We'll create a ``.pyx`` file named ``rect.pyx`` to build our wrapper. We're
using a name other than ``Rectangle``, but if you prefer giving the same name
to the wrapper as the C++ class, see the section on
:ref:`resolving naming conflicts <resolve-conflicts>`.
Within, we use cdef to declare a var of the class with the C++ ``new`` statement:
.. literalinclude:: ../../examples/userguide/wrapping_CPlusPlus/cython_usage.pyx .. literalinclude:: ../../examples/userguide/wrapping_CPlusPlus/cython_usage.pyx
...@@ -164,9 +169,6 @@ instance. ...@@ -164,9 +169,6 @@ instance.
.. literalinclude:: ../../examples/userguide/wrapping_CPlusPlus/rect_ptr.pyx .. literalinclude:: ../../examples/userguide/wrapping_CPlusPlus/rect_ptr.pyx
If you prefer giving the same name to the wrapper as the C++ class, see the
section on :ref:`resolving naming conflicts <resolve-conflicts>`.
Compilation and Importing Compilation and Importing
========================= =========================
......
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