comparison 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
comparison
equal deleted inserted replaced
33:ba47a3d709d7 34:2682a627168c
5 Dec 4, 2007: initial 5 Dec 4, 2007: initial
6 Mar 22, 2016: update to dyncall 0.9, includes breaking sig char changes 6 Mar 22, 2016: update to dyncall 0.9, includes breaking sig char changes
7 Apr 19, 2018: update to dyncall 1.0 7 Apr 19, 2018: update to dyncall 1.0
8 Apr 7, 2020: update to dyncall 1.1, Python 3 support, using the Capsule 8 Apr 7, 2020: update to dyncall 1.1, Python 3 support, using the Capsule
9 API, as well as support for python unicode strings 9 API, as well as support for python unicode strings
10 Apr 11, 2020: support for getting loaded library path
11 Apr 12, 2020: breaking change: restrict 'Z' conversions to immutable types
12 and 'p' to mutable types (and handles)
10 13
11 14
12 BUILD/INSTALLATION 15 BUILD/INSTALLATION
13 ================== 16 ==================
14 17
38 41
39 format: "xxxxx)y" 42 format: "xxxxx)y"
40 43
41 x is positional parameter-type charcode, y is result-type charcode 44 x is positional parameter-type charcode, y is result-type charcode
42 45
43 SIG | FROM PYTHON 2 | FROM PYTHON 3 | C/C++ | TO PYTHON 2 | TO PYTHON 3 46 SIG | FROM PYTHON 2 | FROM PYTHON 3 | C/C++ | TO PYTHON 2 | TO PYTHON 3
44 ----+------------------------------------------------------+------------------------------------------+---------------------------------+--------------------------------------+------------------------------------- 47 ----+---------------------------------+---------------------------------+---------------------------------+--------------------------------------+---------------------------------------
45 'v' | | | void | None (Py_None) (e.g. ret of "...)v") | None (Py_None) (e.g. ret of "...)v") 48 'v' | | | void | None (Py_None) (e.g. ret of "...)v") | None (Py_None) (e.g. ret of "...)v")
46 'B' | bool (PyBool) | bool (PyBool)# | int/bool | bool (PyBool) | bool (PyBool)@ 49 'B' | bool (PyBool) | bool (PyBool) # | int/bool | bool (PyBool) | bool (PyBool) @
47 'c' | int (PyLong)%, str (single char)% | int (PyLong)%, str (single char)% | char | int (PyInt) | int (PyLong) 50 'c' | int (PyInt) % | int (PyLong) % | char | int (PyInt) | int (PyLong)
48 'C' | int (PyLong)%, str (single char)% | int (PyLong)%, str (single char)% | unsigned char | int (PyInt) | int (PyLong) 51 | str (with only a single char) % | str (with only a single char) % | char | int (PyInt) | int (PyLong)
49 's' | int (PyInt)% | int (PyLong)% | short | int (PyInt) | int (PyLong) 52 'C' | int (PyInt) % | int (PyLong) % | unsigned char | int (PyInt) | int (PyLong)
50 'S' | int (PyInt)% | int (PyLong)% | unsigned short | int (PyInt) | int (PyLong) 53 | str (with only a single char) % | str (with only a single char) % | unsigned char | int (PyInt) | int (PyLong)
51 'i' | int (PyInt) | int (PyLong) | int | int (PyInt) | int (PyLong) 54 's' | int (PyInt) % | int (PyLong) % | short | int (PyInt) | int (PyLong)
52 'I' | int (PyInt) | int (PyLong) | unsigned int | int (PyInt) | int (PyLong) 55 'S' | int (PyInt) % | int (PyLong) % | unsigned short | int (PyInt) | int (PyLong)
53 'j' | int (PyInt) | int (PyLong) | long | int (PyInt) | int (PyLong) 56 'i' | int (PyInt) | int (PyLong) | int | int (PyInt) | int (PyLong)
54 'J' | int (PyInt) | int (PyLong) | unsigned long | int (PyInt) | int (PyLong) 57 'I' | int (PyInt) | int (PyLong) | unsigned int | int (PyInt) | int (PyLong)
55 'l' | int (PyInt), long (PyLong) | int (PyLongLong) | long long | long (PyLong) | int (PyLong) 58 'j' | int (PyInt) | int (PyLong) | long | int (PyInt) | int (PyLong)
56 'L' | int (PyInt), long (PyLong) | int (PyLongLong) | unsigned long long | long (PyLong) | int (PyLong) 59 'J' | int (PyInt) | int (PyLong) | unsigned long | int (PyInt) | int (PyLong)
57 'f' | float (PyFloat)$ | float (PyFloat)$ | float | float (PyFloat)^ | float (PyFloat)^ 60 'l' | int (PyInt) | int (PyLongLong) | long long | long (PyLong) | int (PyLong)
58 'd' | float (PyFloat) | float (PyFloat) | double | float (PyFloat) | float (PyFloat) 61 | long (PyLong) | - | long long | long (PyLong) | int (PyLong)
59 'p' | str (PyUnicode/PyString), int (PyInt), long (PyLong) | str (PyUnicode), int (PyLong), (PyBytes) | void* | int,long (Py_ssize_t) | int (Py_ssize_t) 62 'L' | int (PyInt) | int (PyLongLong) | unsigned long long | long (PyLong) | int (PyLong)
60 'Z' | str (PyUnicode/PyString) | str (PyUnicode), (PyBytes) | const char* (UTF-8 for unicode) | int (PyString) | str (PyUnicode) 63 | long (PyLong) | - | unsigned long long | long (PyLong) | int (PyLong)
64 'f' | float (PyFloat) $ | float (PyFloat) $ | float | float (PyFloat) ^ | float (PyFloat) ^
65 'd' | float (PyFloat) | float (PyFloat) | double | float (PyFloat) | float (PyFloat)
66 'p' | bytearray (PyByteArray) & | bytearray (PyByteArray) & | void* | int,long (Py_ssize_t) | int (Py_ssize_t)
67 | int (PyInt) | int (PyLong) | void* | int,long (Py_ssize_t) | int (Py_ssize_t)
68 | long (PyLong) | - | void* | int,long (Py_ssize_t) | int (Py_ssize_t)
69 'Z' | str (PyString) ! | str (PyUnicode) ! | const char* (UTF-8 for unicode) | int (PyString) | str (PyUnicode)
70 | unicode (PyUnicode) ! | - | const char* (UTF-8 for unicode) | int (PyString) | str (PyUnicode)
71 | - | bytes (PyBytes) ! | const char* (UTF-8 for unicode) | int (PyString) | str (PyUnicode)
72 | bytearray (PyByteArray) ! | bytearray (PyByteArray) ! | const char* (UTF-8 for unicode) | int (PyString) | str (PyUnicode)
61 73
62 # converted to 1 if True and 0 otherwise 74 # converted to 1 if True and 0 otherwise
63 @ converted to False if 0 and True otherwise 75 @ converted to False if 0 and True otherwise
64 % range checked 76 % range/length checked
65 $ cast to single precision 77 $ cast to single precision
66 ^ cast to double precision 78 ^ cast to double precision
79 & mutable buffer when passed to C
80 ! immutable buffer when passed to C, as strings (in any form) are considered objects, not buffers
67 81
68 TODO 82 TODO
69 ==== 83 ====
70 84
71 - signature suffixes used to indicate calling conventions are not supported yet! 85 - signature suffixes used to indicate calling conventions are not supported yet!