Luke Paireepinart wrote: > I believe that, if your program is importing 2 other packages, each of > which import some other package, > that other doubly-imported package will only be executed once, by > whichever one you import first.
Yes, that's right. >> itemID = 0 >> class AssemblyItem: >> def __init__(self): >> global itemID >> self.ID = "assemblyItem" + str(itemID) >> itemID += 1 >> > I'm 99% sure you can accomplish the same thing with a variable that is > global to all instances of the class. > something like (may not work): > > class Foo: > itemID = 0 > def __init__(self): > itemID += 1 That should be Foo.itemID += 1; the class namespace is not part of the default name search path. Kent _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor