newbie-question: more then one constructor in a python-class?

T. Kaufmann merman at snafu.de
Sun Jul 7 11:12:36 EDT 2002


Hi python-experts,

is there a way to have more (then one) constructors in a python-class (like in Java)?

I mean something like this in Java:


public class MyClass {

public MyClass() {
... do anything here
}

public MyClass(String param) {
... do anything here
}

public MyClass(String param, StringBuffer param) {
... do anything here
}

public static void main(String [] args) { ... }

}

Thanks for help.

o-o

Thomas




More information about the Python-list mailing list