Author vstinner
Recipients inada.naoki, rhettinger, serhiy.storchaka, vstinner
Date 2016-12-14.08:57:46
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
> Should we use Py_SIZE or _PyDict_GET_SIZE?

I prefer _PyDict_GET_SIZE() just to make the code more readable: it helps to repeat the type of variables.

Moreover, it can give you a free check on the type if you agree my suggestion to add an assertion into the macro directly.

Technically, it's already possible to use Py_SIZE() on lists and tuples, but PyTuple_GET_SIZE() and PyList_GET_SIZE() are used almost everywhere, again, for readability.
Date User Action Args
2016-12-14 08:57:47vstinnersetrecipients: + vstinner, rhettinger, inada.naoki, serhiy.storchaka
2016-12-14 08:57:47vstinnersetmessageid: <>
2016-12-14 08:57:47vstinnerlinkissue28959 messages
2016-12-14 08:57:46vstinnercreate