On Mon, Jun 1, 2009 at 4:55 PM, Alan Gauld <alan.ga...@btinternet.com> wrote:
> We can fake the Delphi style by using a default constructor and then just > calling the "constructors" after initialisation: > > class C: > def __init__(): pass > @constructor > def LoadFromFile(fname, count): ... > �...@constructor > def Create(valueTuple):... > > c = C() > c.LoadFromFile(fn, cnt) > > But its two lines not one... :-( Why not this? class C: def __init__(self): pass @staticmethod def LoadFromFile(fname, count): c = C() # init c from the file return c and similar for Create(). Client code is one line: c = C.LoadFromFile(fn, cnt) Kent _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor