[Numpy-discussion] Behavior of .base

Charles R Harris charlesr.harris at gmail.com
Sun Sep 30 23:11:14 EDT 2012

On Sun, Sep 30, 2012 at 8:30 PM, Charles R Harris <charlesr.harris at gmail.com
> wrote:

> On Sun, Sep 30, 2012 at 1:59 PM, Travis Oliphant <travis at continuum.io>wrote:
>> Hey all,
>> In a github-discussion with Gael and Nathaniel, we came up with a
>> proposal for .base that we should put before this list.    Traditionally,
>> .base has always pointed to None for arrays that owned their own memory and
>> to the "most immediate" array object parent for arrays that did not own
>> their own memory.   There was a long-standing issue related to running out
>> of stack space that this behavior created.
>> Recently this behavior was altered so that .base always points to "the
>> original" object holding the memory (something exposing the buffer
>> interface).   This created some problems for users who relied on the fact
>> that most of the time .base pointed to an instance of an array object.
>> The proposal here is to change the behavior of .base for arrays that
>> don't own their own memory so that the .base attribute of an array points
>> to "the most original object" that is still an instance of the type of the
>> array.      This would go into the 1.7.0 release so as to correct the
>> issues reported.
>> What are reactions to this proposal?
> It sounds like this would solve the problem in the short term, but it is a
> bit of a hack in that the behaviour is more complicated than either the
> original or the current version. So I could see this in 1.7, but it might
> be preferable in the long term to work out what attributes are needed to
> solve Gael's problem more directly.
Although I think the proposal needs to be laid out more exactly with more
details in order to understand what it is. Perhaps an explanation of the
problem with an explanation of how it is solved. A diagram would be helpful
and could go into the documentation.


> Chuck
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20120930/c23a8709/attachment.html>

More information about the NumPy-Discussion mailing list