[issue28959] Add a macro for dict size

INADA Naoki report at bugs.python.org
Tue Dec 13 21:20:16 EST 2016


INADA Naoki added the comment:

I didn't know about PyObject_VAR_HEAD much.
The comment of the macro says:

/* PyObject_VAR_HEAD defines the initial segment of all variable-size
 * container objects.  These end with a declaration of an array with 1
 * element, but enough space is malloc'ed so that the array actually
 * has room for ob_size elements.  Note that ob_size is an element count,
 * not necessarily a byte count.
 */

dict doesn't end with array.
Does Py_SIZE() support recommended, like Python's len()?

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue28959>
_______________________________________


More information about the Python-bugs-list mailing list