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.

eg:

class Foo(object):
  def __init__(self, init, *args, **kw):
    if init == 'this':
      self._initThis(*args, **kw)
    elif init == 'that':
      self.initThat(*args, **kw)

<shrug>

If you're using inheritance, you'll need to do a little more work inside each branch of the if statement.

--
John.
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to