[Python-Dev] Expose the array interface in Python 2.5? (original) (raw)

Scott David Daniels Scott.Daniels at Acm.Org
Sat Mar 18 19:13:25 CET 2006


Greg Ewing wrote:

Nick Coghlan wrote:

The former seems fairly pointless, and the latter difficult (since it has implications for moving the data store when the array gets resized). I don't see why that should be a serious problem, as long as it's understood that the address reported by the array interface is only for temporary use. I also don't see what relevance the semantics of Python indexing or mutation has. The array interface should just report the location and shape of the data as it happens to be when the call is made. What happens to it in between times is entirely up to the object.

But it might be nice to be able to determine if the object has a way of promising a constant address while a reference is held. The array.array implementation could simply say, "nope." I certainly have use for implementations that can give better guarantees, and I'd like to be able to distinguish the two.

--Scott David Daniels Scott.Daniels at Acm.Org



More information about the Python-Dev mailing list