[Tutor] Contructor Overloading and Function Tooktips
jfouhy at paradise.net.nz
Sat Apr 16 00:20:48 CEST 2005
Gooch, John wrote:
> Is there a way to create multiple __init__ routines in a Python Class?
Not directly (well, not that I know of). But you can always emulate it.
def __init__(self, init, *args, **kw):
if init == 'this':
elif init == 'that':
If you're using inheritance, you'll need to do a little more work inside
each branch of the if statement.
More information about the Tutor