Author gregory.p.smith
Recipients docs@python, gregory.p.smith
Date 2014-07-09.19:44:44
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1404935084.68.0.420259951718.issue21949@psf.upfronthosting.co.za>
In-reply-to
Content
The Py_SIZE() macro is not documented.  It should be.  It is very useful along with PyList_New(positive_number) after using PyList_SET_ITEM() to fill in up to the first positive_number elements of a list object in the most optimal manner by avoiding numerous redundant array resizes and error checks along the away.

The Py_SIZE() macro was introduced (in 2.6 I believe) and is specifically intended for use as an lvalue (see http://bugs.python.org/issue1724 to confirm that).  It currently has uses in several places in CPython's core and modules as well as within some third party extension modules and tools such as Cython).
History
Date User Action Args
2014-07-09 19:44:44gregory.p.smithsetrecipients: + gregory.p.smith, docs@python
2014-07-09 19:44:44gregory.p.smithsetmessageid: <1404935084.68.0.420259951718.issue21949@psf.upfronthosting.co.za>
2014-07-09 19:44:44gregory.p.smithlinkissue21949 messages
2014-07-09 19:44:44gregory.p.smithcreate