Travis Oliphant wrote:
Yes you could call this (but you would call it from the type object like this
Or more likely (and I should add this to the C-API) you would call.
yes, that's what I'm looking for -- please do add that to the C-API
By the way,, how compatible is this with the existing buffer protocol?
It's basically orthogonal. In other-words, if you defined the array view protocol you would not need the buffer protocol at all. But you could easily define both.
OK, so if one of these were passed into something expecting the buffer protocol, then it wouldn't work, but you could make an object conform to both protocols at once -- like numpy does now, I suppose -- very nice.
Another question -- is this new approach in response to feedback from Guido and or other Python devs? This sure seems like a good way to go -- though it seems from the last discussion I followed at python-dev, most of the devs just didn't get how useful this would be!