We may modify PyXXX_GET_SIZE() to add assert(PyXXX_Check()) to help to
detect bugs and misuses of these macros in debug mode.
The problem is that I expect a compilation error on PyXXX_GET_SIZE()=size.
The new PyDict_GET_SIZE() macro has the assertion. Use Py_SIZE() to set the
size.
Victor
Le 20
On Mon, Mar 20, 2017, at 13:18, Antoine Pitrou wrote:
> On Mon, 20 Mar 2017 13:26:34 +0200
> Serhiy Storchaka 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
On Mon, 20 Mar 2017 13:26:34 +0200
Serhiy Storchaka 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 out
On Mon, 20 Mar 2017 at 04:28 Serhiy Storchaka 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?
>
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?
On one hand concrete type macros are longer than Py_SIZE, a