Initializing a set from a list

Xiaolei propheci at gmail.com
Wed Jun 21 03:12:51 EDT 2006


Sybren Stuvel wrote:
> Xiaolei enlightened us with:
> > from pylab import *
>
> You'd better not do that. Just use "import pylab".
>
> > If I remove the first line, I correctly get:
> >
> > [1, 2, 3, 3]
> ><type 'set'>
> > set([1, 2, 3])
>
> Pylab shadows the built-in set name, which is one of the reasons you
> should generally use "import XXX" instead of "from XXX import *".

Ahh.  Understood.  Thank you very much.




More information about the Python-list mailing list