On Wed, 22 Jun 2005 12:34:21 -0500, Rocco Moretti wrote: > scott wrote: >> hi people, >> >> can someone tell me, how to use a class like that* (or "simulate" more >> than 1 constructor) : >> #--
[snip] > You could also turn __init__ into a dispatch fuction: > > #-- > class myPointClass: > def __init__(self, *args): > if len(args) <= 2: > self.__init_two(*args) > if len(args) == 3: > self.__init_three(*args) Oh wow, so that's what I've been doing for years. Dispatching. And I thought I was just calling other functions :-) That's the joys of a mostly self-taught programming knowledge: you miss out on all the buzzwords. -- Steven. -- http://mail.python.org/mailman/listinfo/python-list
