Gregor Lingl wrote: > Hi everyoen, > > say in some module I have defined a class Pen > and I want an alias for the class name, say > Turtle > > I can do this: > > class Turtle(Pen): > pass > > or simply (after having defined Pen): > > Turtle = Pen > > Are those two variants different in effect? > Are there pros or cons for one of both > variants? > > Regards, > Gregor If you are making an alias... use Turtle = Pen... Inheritance for this seems WAY too weird. It took me a minute to realise what you were trying to do. Instead, Turtle = Pen is clear and direct... More "pythonic" perhaps.
Also, Inheritance may cause some variables to be hardly accesible (like if they're __mangled). Ismael _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor