From: Derrick S. <Der...@no...> - 2005-05-18 17:05:50
|
Fernando Perez wrote: > John Hunter wrote: > >>>>>>> "Tim" == Tim Leslie <ti...@cs...> writes: >>>>>> >> >> >> I'm wondering if set is now a bad name for pylab to be using? >> >> Tim> +1 for changing it. >> >> Tim> I've also had this issue bite me when I was hacking together >> Tim> some code and wanted to use a python set. I'd be in favour of >> Tim> changing the pylab set to be called something else, although >> Tim> I don't have any good suggestions about what to change it >> Tim> to... >> >> Ouch, I hadn't thought of this. In the past, consensus has been that >> pylab should not override built-ins, eg the previous discussion on >> min/max which led us to rename these functions to amin/amax. Changing >> set, unfortunately, will break a lot of scripts. I think the best >> plan of action is to define a new function pset or setp (setp for "set >> property") which has the functionality of the old, and keep set around >> for a release or two issuing a warning with a line number so people >> can get their existing scripts cleaned up. > > > I'd also suggest removing from all example code 'from pylab import *' > statements. Frankly, after a while I've completely stopped using > 'from foo import *' in _any_ code I write, even small scripts. All I > use these days is code like: > > import Numeric as N > import scipy as S > import pylab as P > > The only place where I think that from-import-* is OK is at an > interactive prompt, where you are just doing experiments and not > writing reusable code. > > Since the examples tend to be the place that people learn from, I > think it would be a good idea to encourage safer practices by banning > the dangerous import-* idiom from there. > > Just my opinion. > > Best, > > f > > > ------------------------------------------------------- > This SF.Net email is sponsored by Oracle Space Sweepstakes > Want to be the first software developer in space? > Enter now for the Oracle Space Sweepstakes! > http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users As the new learner that Fernando alludes to, I'd like to second his opinion. As we speak, I'm looking through examples I've collected trying to piece together something useful for my work. The namespace conflicts are a huge frustration, especially with regard to numarray/Numeric overlap. As a newbie, this is almost a show stopper. I'll figure it out eventually I hope... |