ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> numpy-discussion
numpy-discussion
Re: [Numpy-discussion] rank-0 arrays
by Pearu Peterson other posts by this author
Sep 16 2002 11:09PM messages near this date
Re: [Numpy-discussion] rank-0 arrays | Re: [Numpy-discussion] rank-0 arrays
On Mon, 16 Sep 2002, Travis Oliphant wrote:

>  > Frankly, I have no idea what the implimentation details would be, but
>  > could we get rid of rank-0 arrays altogether? I have always simply found
>  > them strange and confusing... What are they really neccesary for
>  > (besides holding scalar values of different precision that standard
>  > Pyton scalars)?
>  
>  With new coercion rules this becomes a possibility.  Arguments against it
>  are that special rank-0 arrays behave as more consistent numbers with the
>  rest of Numeric than Python scalars.  In other words they have a length
>  and a shape and one can right N-dimensional code that works the same even
>  when the result is a scalar.

In addition, rank-0 arrays are mutable while Python scalars are not.
Mutability is sometimes useful (e.g. when emulating C or Fortran
calls in Python) but often also evil due to its unpythonic side effect.

Pearu



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Numpy-discussion mailing list
Numpy-discussion@[...].net
https://lists.sourceforge.net/lists/listinfo/numpy-discussion
Thread:
Perry Greenfield
Travis Oliphant
Pearu Peterson
Konrad Hinsen
Perry Greenfield
Todd Miller
Pearu Peterson
Konrad Hinsen
Travis Oliphant
Konrad Hinsen
Perry Greenfield
Travis Oliphant
Tim Hochberg
Chris Barker
Konrad Hinsen
Perry Greenfield
Travis Oliphant
Pearu Peterson
Tim Hochberg
Perry Greenfield
Konrad Hinsen
Perry Greenfield
eric jones
Konrad Hinsen
eric jones
Konrad Hinsen
Tim Hochberg
Tim Hochberg
Paul F Dubois
Scott Gilbert
Konrad Hinsen

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved