Using Multiple Constructors

Mikhael Loo mikhael at lib-sys.com
Fri Aug 3 16:51:48 EDT 2001


How do you use multiple constructors in a python class.  I'm guesing that it
doesn't involve multiple __init__ functions.

Below is my idea but I'm thinking there must be another method that  is
evading me.

Class MyObject:
    Constructor1(self, number):
        pass
    Constructor2(self, string):
        pass

Help anyone?







More information about the Python-list mailing list