[Numpy-discussion] [Matplotlib-users] [matplotlib-devel] Unifying numpy, scipy, and matplotlib docstring formats
Barry Wark
barrywark at gmail.com
Sun Feb 18 02:41:14 EST 2007
Perhaps we should consider two use cases: interactive use ala Matlab
and larger code bases. In the first case, being able to import * saves
a lot of typing and the namespace polution problem isn't a big deal.
The second use, obviously, benefits from avoiding import *.
Returning to the OP's questions, why couldn't both cases be helped by
creating a "meta-package" for numpy, scipy, and matplotlib? For the
sake of argument, lets call the package "plab". Existing code could be
affected by changing the individual packages, but a package that
essentially does
from pylab import *
from numpy import *
from scipy import *
would give a standard API that future code and interactive use could
use. Code could do
import plab
plab.plot() #etc.
and interactive use could do from plab import *.
Just a thought...
Barry
On 2/16/07, Matthew Brett <matthew.brett at gmail.com> wrote:
> Hi,
>
> > I think a consensus is building in the python community that you should
> > NEVER use import *!
>
> Well, I have only been coding python for a few years, but I would say,
> along with writing unit tests, the great importance of not using
> import * is one of the secrets that you learn slowly and painfully
> with experience. Chris' point about the movement of big projects away
> from that idiom is a very good one. It is convenient, but over time
> you realize that the value of convenience is far outweighed by the
> namespace mess and loss of clarity that results.
>
> Best,
>
> Matthew
>
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share your
> opinions on IT & business topics through brief surveys-and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> Matplotlib-users mailing list
> Matplotlib-users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
More information about the NumPy-Discussion
mailing list