Commit caf66ec8 authored by scoder's avatar scoder Committed by GitHub

Merge pull request #2449 from gabrieldemarmiesse/automatic_type_conversion_plus

Added the C array conversion to and from python in "language basics".
parents e59c0d08 c054d187
...@@ -556,6 +556,8 @@ possibilities. ...@@ -556,6 +556,8 @@ possibilities.
+----------------------------+--------------------+------------------+ +----------------------------+--------------------+------------------+
| char* | str/bytes | str/bytes [#]_ | | char* | str/bytes | str/bytes [#]_ |
+----------------------------+--------------------+------------------+ +----------------------------+--------------------+------------------+
| C array | iterable | list [#2]_ |
+----------------------------+--------------------+------------------+
| struct, | | dict [#1]_ | | struct, | | dict [#1]_ |
| union | | | | union | | |
+----------------------------+--------------------+------------------+ +----------------------------+--------------------+------------------+
...@@ -568,6 +570,10 @@ possibilities. ...@@ -568,6 +570,10 @@ possibilities.
combinations. An example is a union of an ``int`` and a ``char*``, combinations. An example is a union of an ``int`` and a ``char*``,
in which case the pointer value may or may not be a valid pointer. in which case the pointer value may or may not be a valid pointer.
.. [#2] Other than signed/unsigned char[].
The conversion will fail if the length of C array is not known at compile time,
and when using a slice of a C array.
Caveats when using a Python string in a C context Caveats when using a Python string in a C context
------------------------------------------------- -------------------------------------------------
......
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