[Python-Dev] graphics maths types in python core?

Nick Coghlan ncoghlan at gmail.com
Sun Apr 5 09:13:39 CEST 2009

Antoine Pitrou wrote:
> Greg Ewing <greg.ewing <at> canterbury.ac.nz> writes:
>> So you're saying the buffer interface *has* been fully
>> implemented, it just hasn't been tested very well?
> No, it hasn't been implemented for multi-dimensional types, and it hasn't been
> really tested for anything other than plain linear collections of bytes.
> (I have added tests for arrays in test_memoryview, but that's all. And that's
> only in py3k since array.array in 2.x only supports the old buffer interface)

Step back for a sec here... PEP 3118 has three pieces, not two.

Part 1, the actual new buffer protocol, is complete and works fine as
far as I know. If it didn't, we would have heard about it from the third
clients of the new protocol by now.

Parts 2 and 3, being the memoryview API and support for the new protocol
in the builtin types are the parts that are currently restricted to
simple linear memory views.

That's largely because parts 2 and 3 are somewhat use case challenged:
the key motivation behind PEP 3118 was so that libraries like NumPy, PIL
and the like would have a common standard for data interchange. Since
those all have their own extension objects and will be using the PEP
3118 C API directly rather than going through memoryview, the state of
the Python API and the support from builtin containers types is largely
irrelevant to the target audience for the PEP.

Actually *finishing* parts 2 and 3 of PEP 3118 would be a good precursor
 to having some kind of multi-dimensional mathematics in the standard
library though.


Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia

More information about the Python-Dev mailing list