Message340236
> 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. |
|
Date |
User |
Action |
Args |
2019-04-14 21:29:15 | Eric Wieser | set | recipients:
+ Eric Wieser, terry.reedy, teoliphant, amaury.forgeotdarc, belopolsky, skrah, meador.inge, Eric.Wieser |
2019-04-14 21:29:15 | Eric Wieser | set | messageid: <1555277355.13.0.844035648176.issue32782@roundup.psfhosted.org> |
2019-04-14 21:29:15 | Eric Wieser | link | issue32782 messages |
2019-04-14 21:29:15 | Eric Wieser | create | |
|