[Numpy-discussion] Ransom Proposals

Fernando Perez Fernando.Perez at colorado.edu
Sat Mar 25 18:14:05 CST 2006


Sasha wrote:
> On 3/25/06, Fernando Perez <Fernando.Perez at colorado.edu> wrote:
> 
>>At least I know /I/ will forget, get confused, and make mistakes.  So I'd like
>>to ask for as-uniform-as possible behavior.
> 
> 
> Do I understand correctly that you and Tim propose to make
> reshape(obj, shape) return a view if obj is an instance of ndarray and
> throw an exception otherwise?

I don't propose anything in particular.  I just don't want the reshape(foo) is 
a view on the even days of the week and a copy on the odd ones thingie :)

All I'm asking is for an API that has as few special cases as possible, so 
that we can both learn (and teach) a small set of rules that apply everywhere. 
  For example, the 'foo[a:b:c] for arrays is a view while a copy for a slice', 
while a special case, is justifiable to new users as necessary given the 
performance requirements of numpy (though there's been musings on python-dev 
of changing to such semantics in py3k, which would be great for us).

But such special rules, whether regarding deviations against the core language 
or internally within numpy, should (IMHO) be kept to an absolute minimum.  We 
should treat them as expensive specialties we must pay for with a very tight 
budget (the willingness and ability of users to keep track of the exponential 
rise in complexity induced by interlocking special cases).

Cheers,

f




More information about the Numpy-discussion mailing list