[Numpy-discussion] Poll on a Rank-0 arrays: please give +1, -1, or 0

Travis Oliphant oliphant at ee.byu.edu
Sat Feb 19 13:46:15 EST 2005


We need to get some opinions regarding the recent discussion on rank-0 
arrays.   Please give your  vote +1 (like), -1 (hate), or 0 (don't 
care)  for **each** of the following possibilities.  Feel free to 
clarify your vote if you need to.


1)  Rank-0 arrays are always returned from uarray operations, Python 
scalars available on request only.   (*If* arrayobject get's into Python 
core, Guido has agreed to let rank-0 integer arrays be used as
index variables).  Rank-0 arrays are made to resmbe scalar of



2) Rank-0 arrays are never returned from uarray operations (unless using 
asarray on a scalar), and when a rank-0 array naturally appears in the 
calculation, an appropriate Python scalar is returned (note that this 
would lose precision for long doubles unless a new Python object was 
created).



3) The current compromise is continued and for some types a Python 
scalar is returned, while for other types a  rank-0 array is returned



4) Rank-0 arrays are made equivalent to Python scalars and a new Python 
scalar for each fundamental data type supported by uarray is constructed 
(rank-0 arrays would still probably be used internally, but users would 
not have to know this).   The new Python-scalars would inherit from an 
existing Python scalar where appropriate and would have the same 
attributes and methods of uarrays (very likely at least initially they 
would be seemlessly converted to rank-0 arrays when "mixed" operations 
occur).










More information about the NumPy-Discussion mailing list