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
217a93e7
Commit
217a93e7
authored
Apr 05, 2021
by
da-woods
Committed by
GitHub
Apr 05, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Document some additional C++ auto-conversions (GH-4090)
parent
18970d35
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
13 deletions
+21
-13
docs/src/userguide/wrapping_CPlusPlus.rst
docs/src/userguide/wrapping_CPlusPlus.rst
+21
-13
No files found.
docs/src/userguide/wrapping_CPlusPlus.rst
View file @
217a93e7
...
@@ -331,19 +331,27 @@ arguments) or by an explicit cast, e.g.:
...
@@ -331,19 +331,27 @@ arguments) or by an explicit cast, e.g.:
The following coercions are available:
The following coercions are available:
+------------------+----------------+-----------------+
+------------------+------------------------+-----------------+
| Python type => | *C++ type* | => Python type |
| Python type => | *C++ type* | => Python type |
+==================+================+=================+
+==================+========================+=================+
| bytes | std::string | bytes |
| bytes | std::string | bytes |
+------------------+----------------+-----------------+
+------------------+------------------------+-----------------+
| iterable | std::vector | list |
| iterable | std::vector | list |
+------------------+----------------+-----------------+
+------------------+------------------------+-----------------+
| iterable | std::list | list |
| iterable | std::list | list |
+------------------+----------------+-----------------+
+------------------+------------------------+-----------------+
| iterable | std::set | set |
| iterable | std::set | set |
+------------------+----------------+-----------------+
+------------------+------------------------+-----------------+
| iterable (len 2) | std::pair | tuple (len 2) |
| iterable | std::unordered_set | set |
+------------------+----------------+-----------------+
+------------------+------------------------+-----------------+
| mapping | std::map | dict |
+------------------+------------------------+-----------------+
| mapping | std::unordered_map | dict |
+------------------+------------------------+-----------------+
| iterable (len 2) | std::pair | tuple (len 2) |
+------------------+------------------------+-----------------+
| complex | std::complex | complex |
+------------------+------------------------+-----------------+
All conversions create a new container and copy the data into it.
All conversions create a new container and copy the data into it.
The items in the containers are converted to a corresponding type
The items in the containers are converted to a corresponding type
...
...
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