[Numpy-discussion] rant against from numpy import * / from pylab import *

Sebastian Haase haase@msg.ucsf....
Thu Mar 15 23:57:44 CDT 2007


Hi!
I use the wxPython PyShell.
I like especially the feature that when typing a module and then the
dot "." I get a popup list of all available functions (names) inside
that module.

Secondly,  I think it really makes code clearer when one can see where
a function comes from.

I have a default
import numpy as N
executed before my shell even starts.
In fact I have a bunch of my "standard" modules imported as <some
single capital letter>.

This - I think - is a good compromise to the commonly used "extra
typing" and "unreadable"  argument.

a = sin(b) * arange(10,50, .1) * cos(d)
vs.
a = N.sin(b) * N.arange(10,50, .1) * N.cos(d)

I would like to hear some comments by others.


On a different note: I just started using pylab, so I did added an
automatic  "from matplotlib import pylab as P" -- but now P contains
everything that I already have in N.  It makes it really hard to
*find* (as in *see* n the popup-list) the pylab-only functions. --
what can I do about this ?


Thanks,
Sebastian


More information about the Numpy-discussion mailing list