Re: [Numpy-discussion] Priority rules between numpy scalars and 0d arrays

2008-10-13 Thread Pierre GM
Travis, > The problem is that there has never been a formal "resolution" (that I > recall) of when should something be returned as a 0-d array and when it > should be returned as a scalar. There is rather an informal > implementation of what actually happens. Ah. It might be worth putting the

Re: [Numpy-discussion] Priority rules between numpy scalars and 0d arrays

2008-10-13 Thread Travis E. Oliphant
Pierre GM wrote: > All, > Sorry to bring back this subject, but I still haven't got any proper answers: > > * What are the priority rules between numpy scalars and 0d arrays ? > There aren't really any specified. However, there is behavior that emerges from what is specified. The problem is t

[Numpy-discussion] Priority rules between numpy scalars and 0d arrays

2008-10-13 Thread Pierre GM
All, Sorry to bring back this subject, but I still haven't got any proper answers: * What are the priority rules between numpy scalars and 0d arrays ? When multiplying a numpy scalar by a 0d array, shouldn't the __mul__ or __rmul__ methods of the array be called ? Should the result be a numpy sc