[Numpy-discussion] Making NumPy accessible to everyone (or no-one) (was Numpy-discussion Digest, Vol 19, Issue 44)

Lou Pecora lou_boog2000 at yahoo.com
Thu Apr 10 13:17:29 EDT 2008


--- Alexander Michael <lxander.m at gmail.com> wrote:

> Hey! I use np *all the time* as an abbreviation for
> "number of points". I don't
> really see what the problem is with using
> numpy.whatever in library code and
> published scripts and whatever you want in one-off
> throw-away scripts. It's easy
> to setup a shortcut key in almost any editor to
> alleviate the typing burden, if
> that is the main objection. If you have a section of
> an algorithm that you are
> trying to make look as much like text-book
> pseudocode as possible, than you
> can't do better than "from numpy import whatever"
> both for clarity and python
> coding convention. You can also say "d = numpy.dot"
> in the local scope at the
> top of your algorithm so you can write "d(x,y)" in
> the algorithm itself for very
> pithy code that doesn't require a FAQ to understand.

Yes, I use np= number of points, too.  But you all
might want to use something else.  That's the point of
the flexibility of import ... as 

Trying to lock in namespaces as np or N or whatever is
a BAD idea.  Allow the flexibility.  You can admonish
against from ... import * for newbies and then tell
them to use from ... import actual function names (as
mentioned above).  But locking people into a standard,
even an informal one is, as someone else said, acting
a bit too much like accountants.  Stop, please!



-- Lou Pecora,   my views are my own.

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 



More information about the NumPy-Discussion mailing list