[Numpy-discussion] Args for ones, zeros, rand, eye, ones, empty (possible 1.0 change?)

Sven Schreiber svetosch at gmx.net
Mon Jul 3 14:56:04 CDT 2006


Sasha schrieb:

> 
> Consistency is already lost because 1d case allows both ones(5) and
> ones([5]) (and even ones((5,)) if anyone can tolerate that
> abomination).  I don't think those who argue for sequence only are
> willing to require ones([5]).

Imho consistency is not lost there precisely because one can use
ones((5)) if one is so inclined. So the double-parentheses habit (or
call it tuple-habit if you like) goes through. In contrast, rand((5,5))
fails, and that is what breaks consistency.

> 
> Remember, "A Foolish Consistency is the Hobgoblin of Little Minds"
> (Ralph Waldo Emerson (1803–1882),  adopted without attribution as a
> section heading in PEP 8 <http://www.python.org/dev/peps/pep-0008>).

A "little mind" is an accurate description of myself in the numpy field.
But I believe that in order to become a success, numpy must take into
account the needs of little minds as well.

> 
> I think the current situation strikes the right balance between
> convenience and consistency.

I was arguing that it's inconvenient exactly because it's inconsistent,
so I don't see the tradeoff here. (Given that I'm fairly indifferent
between one or two pairs of parentheses.)

In any case I promise to shut up about this when 1.0(beta) is out, but I
think Alan is right that under the status quo there will be a constant
stream of the same newbie question that I asked.

cheers,
Sven






More information about the Numpy-discussion mailing list