On Mon, 20 Mar 2017 13:26:34 +0200 Serhiy Storchaka <storch...@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). Regards Antoine. _______________________________________________ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com