[Python-Dev] Py_SIZE vs PyXXX_GET_SIZE
Benjamin Peterson
benjamin at python.org
Tue Mar 21 02:22:46 EDT 2017
More information about the Python-Dev mailing list
Tue Mar 21 02:22:46 EDT 2017
- Previous message (by thread): [Python-Dev] Py_SIZE vs PyXXX_GET_SIZE
- Next message (by thread): [Python-Dev] Py_SIZE vs PyXXX_GET_SIZE
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Mon, Mar 20, 2017, at 13:18, Antoine Pitrou wrote: > On Mon, 20 Mar 2017 13:26:34 +0200 > Serhiy Storchaka <storchaka at gmail.com> wrote: > > What is the preferable way of getting the size of tuple, list, bytes, > > bytearray: Py_SIZE or PyTuple_GET_SIZE, PyList_GET_SIZE, > > PyBytes_GET_SIZE, PyByteArray_GET_SIZE? Are macros for concrete types > > more preferable or they are outdated? > > +1 for using concrete macros. Py_SIZE is a low-level internal thing > (e.g. it will return a negative size on negative ints). +1 Py_SIZE is an implementation detail of varsize types. Using the concrete macros also the implementation to change without altering API consumers.
- Previous message (by thread): [Python-Dev] Py_SIZE vs PyXXX_GET_SIZE
- Next message (by thread): [Python-Dev] Py_SIZE vs PyXXX_GET_SIZE
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-Dev mailing list