This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Eric Wieser
Recipients Eric Wieser, Eric.Wieser, amaury.forgeotdarc, belopolsky, meador.inge, skrah, teoliphant, terry.reedy
Date 2019-04-14.21:29:15
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1555277355.13.0.844035648176.issue32782@roundup.psfhosted.org>
In-reply-to
Content
> Revising the code example to use an empty array

I think you mean

>>> import array
>>> memoryview(array.array('H', [])).itemsize
2

Your example is an array containing 0, not an empty array - but the conclusion is the same.

> It is technically un-necessary as it can be obtained using PyBuffer_SizeFromFormat

This obviously predicates on `PyBuffer_SizeFromFormat` being implemented, which according to the docs it is not.

> I think that the grammar would allow for an empty record "T{}" that would have itemsize 0 but is of little use inside numpy.

It also allows for records of empty arrays, "T{(0)d:data:}". While these are of little use, they _are_ supported by both ctypes and numpy, so we should support them in the PEP3118 interface used between them.
History
Date User Action Args
2019-04-14 21:29:15Eric Wiesersetrecipients: + Eric Wieser, terry.reedy, teoliphant, amaury.forgeotdarc, belopolsky, skrah, meador.inge, Eric.Wieser
2019-04-14 21:29:15Eric Wiesersetmessageid: <1555277355.13.0.844035648176.issue32782@roundup.psfhosted.org>
2019-04-14 21:29:15Eric Wieserlinkissue32782 messages
2019-04-14 21:29:15Eric Wiesercreate