On Mon, 2005-01-31 at 18:20, Kent Johnson wrote: > > In 2.4 I tried 'from sets import set' > > should be 'from sets import Set' - the class in the sets module is called > Set, the builtin class is set. > I tried it as 'set' and 'Set' but got the same result > > > > Traceback (most recent call last): > > File "/home/glen/set4.py", line 1, in -toplevel- > > from sets import set > > ImportError: cannot import name set > > > > It did allow 'from sets import *' but when using the set command > > I got some odd output... > > > > from sets import * > > a=[12,54,67,47,98,76] > > b=[47,54] > > print set(a)-set(b) > > > > > > set(['dog','sheep,'cow']) > > set([76, 98, 67, 12]) > > ?? Where did the animals come from??
That's the odd output, that was from a previous set command, even after a reboot it still came out the same. Inbuilt set works fine. _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor