diff python/pydc/README.txt @ 34:2682a627168c

- breaking changes: * restrict 'Z' conversions to immutable types * restrict 'p' to mutable types (and handles)
author Tassilo Philipp
date Sun, 12 Apr 2020 19:37:37 +0200
parents baf087cf5971
children 75fe1dec0eb4
line wrap: on
line diff
--- a/python/pydc/README.txt	Sat Apr 11 20:00:25 2020 +0200
+++ b/python/pydc/README.txt	Sun Apr 12 19:37:37 2020 +0200
@@ -7,6 +7,9 @@
 Apr 19, 2018: update to dyncall 1.0
 Apr  7, 2020: update to dyncall 1.1, Python 3 support, using the Capsule
               API, as well as support for python unicode strings
+Apr 11, 2020: support for getting loaded library path
+Apr 12, 2020: breaking change: restrict 'Z' conversions to immutable types
+              and 'p' to mutable types (and handles)
 
 
 BUILD/INSTALLATION
@@ -40,30 +43,41 @@
 
     x is positional parameter-type charcode, y is result-type charcode
 
-  SIG | FROM PYTHON 2                                        | FROM PYTHON 3                            | C/C++                           | TO PYTHON 2                          | TO PYTHON 3
-  ----+------------------------------------------------------+------------------------------------------+---------------------------------+--------------------------------------+-------------------------------------
-  'v' |                                                      |                                          | void                            | None (Py_None) (e.g. ret of "...)v") | None (Py_None) (e.g. ret of "...)v")
-  'B' | bool (PyBool)                                        | bool (PyBool)#                           | int/bool                        | bool (PyBool)                        | bool (PyBool)@
-  'c' | int (PyLong)%, str (single char)%                    | int (PyLong)%, str (single char)%        | char                            | int (PyInt)                          | int (PyLong)
-  'C' | int (PyLong)%, str (single char)%                    | int (PyLong)%, str (single char)%        | unsigned char                   | int (PyInt)                          | int (PyLong)
-  's' | int (PyInt)%                                         | int (PyLong)%                            | short                           | int (PyInt)                          | int (PyLong)
-  'S' | int (PyInt)%                                         | int (PyLong)%                            | unsigned short                  | int (PyInt)                          | int (PyLong)
-  'i' | int (PyInt)                                          | int (PyLong)                             | int                             | int (PyInt)                          | int (PyLong)
-  'I' | int (PyInt)                                          | int (PyLong)                             | unsigned int                    | int (PyInt)                          | int (PyLong)
-  'j' | int (PyInt)                                          | int (PyLong)                             | long                            | int (PyInt)                          | int (PyLong)
-  'J' | int (PyInt)                                          | int (PyLong)                             | unsigned long                   | int (PyInt)                          | int (PyLong)
-  'l' | int (PyInt), long (PyLong)                           | int (PyLongLong)                         | long long                       | long (PyLong)                        | int (PyLong)
-  'L' | int (PyInt), long (PyLong)                           | int (PyLongLong)                         | unsigned long long              | long (PyLong)                        | int (PyLong)
-  'f' | float (PyFloat)$                                     | float (PyFloat)$                         | float                           | float (PyFloat)^                     | float (PyFloat)^
-  'd' | float (PyFloat)                                      | float (PyFloat)                          | double                          | float (PyFloat)                      | float (PyFloat)
-  'p' | str (PyUnicode/PyString), int (PyInt), long (PyLong) | str (PyUnicode), int (PyLong), (PyBytes) | void*                           | int,long (Py_ssize_t)                | int (Py_ssize_t)
-  'Z' | str (PyUnicode/PyString)                             | str (PyUnicode), (PyBytes)               | const char* (UTF-8 for unicode) | int (PyString)                       | str (PyUnicode)
+  SIG | FROM PYTHON 2                   | FROM PYTHON 3                   | C/C++                           | TO PYTHON 2                          | TO PYTHON 3
+  ----+---------------------------------+---------------------------------+---------------------------------+--------------------------------------+---------------------------------------
+  'v' |                                 |                                 | void                            | None (Py_None) (e.g. ret of "...)v") | None (Py_None) (e.g. ret of "...)v")
+  'B' | bool (PyBool)                   | bool (PyBool)                 # | int/bool                        | bool (PyBool)                        | bool (PyBool)                        @
+  'c' | int (PyInt)                   % | int (PyLong)                  % | char                            | int (PyInt)                          | int (PyLong)
+      | str (with only a single char) % | str (with only a single char) % | char                            | int (PyInt)                          | int (PyLong)
+  'C' | int (PyInt)                   % | int (PyLong)                  % | unsigned char                   | int (PyInt)                          | int (PyLong)
+      | str (with only a single char) % | str (with only a single char) % | unsigned char                   | int (PyInt)                          | int (PyLong)
+  's' | int (PyInt)                   % | int (PyLong)                  % | short                           | int (PyInt)                          | int (PyLong)
+  'S' | int (PyInt)                   % | int (PyLong)                  % | unsigned short                  | int (PyInt)                          | int (PyLong)
+  'i' | int (PyInt)                     | int (PyLong)                    | int                             | int (PyInt)                          | int (PyLong)
+  'I' | int (PyInt)                     | int (PyLong)                    | unsigned int                    | int (PyInt)                          | int (PyLong)
+  'j' | int (PyInt)                     | int (PyLong)                    | long                            | int (PyInt)                          | int (PyLong)
+  'J' | int (PyInt)                     | int (PyLong)                    | unsigned long                   | int (PyInt)                          | int (PyLong)
+  'l' | int (PyInt)                     | int (PyLongLong)                | long long                       | long (PyLong)                        | int (PyLong)
+      | long (PyLong)                   | -                               | long long                       | long (PyLong)                        | int (PyLong)
+  'L' | int (PyInt)                     | int (PyLongLong)                | unsigned long long              | long (PyLong)                        | int (PyLong)
+      | long (PyLong)                   | -                               | unsigned long long              | long (PyLong)                        | int (PyLong)
+  'f' | float (PyFloat)               $ | float (PyFloat)               $ | float                           | float (PyFloat)                    ^ | float (PyFloat)                      ^
+  'd' | float (PyFloat)                 | float (PyFloat)                 | double                          | float (PyFloat)                      | float (PyFloat)
+  'p' | bytearray (PyByteArray)       & | bytearray (PyByteArray)       & | void*                           | int,long (Py_ssize_t)                | int (Py_ssize_t)
+      | int (PyInt)                     | int (PyLong)                    | void*                           | int,long (Py_ssize_t)                | int (Py_ssize_t)
+      | long (PyLong)                   | -                               | void*                           | int,long (Py_ssize_t)                | int (Py_ssize_t)
+  'Z' | str (PyString)                ! | str (PyUnicode)               ! | const char* (UTF-8 for unicode) | int (PyString)                       | str (PyUnicode)
+      | unicode (PyUnicode)           ! | -                               | const char* (UTF-8 for unicode) | int (PyString)                       | str (PyUnicode)
+      | -                               | bytes (PyBytes)               ! | const char* (UTF-8 for unicode) | int (PyString)                       | str (PyUnicode)
+      | bytearray (PyByteArray)       ! | bytearray (PyByteArray)       ! | const char* (UTF-8 for unicode) | int (PyString)                       | str (PyUnicode)
 
 # converted to 1 if True and 0 otherwise
 @ converted to False if 0 and True otherwise
-% range checked
+% range/length checked
 $ cast to single precision
 ^ cast to double precision
+& mutable buffer when passed to C
+! immutable buffer when passed to C, as strings (in any form) are considered objects, not buffers
 
 TODO
 ====