Re: Overloading Methods

2009-01-21 Thread "
Chris Rebert wrote: On Tue, Jan 20, 2009 at 10:18 AM, MRAB wrote: K-Dawg wrote: Can you overload methods in Python? Can I have multiple __inits__ with different parameters passed in? Simple answer: no. More complicated answer: Yes, with some caveats. You usually don't need to overload me

Re: Overloading Methods

2009-01-20 Thread TheFlyingDutchman
> > class Foo(object): > def __init__(self, a, b=10, c=None): > > Whereas in Java or C++ this would require several overloads, it can be > succinctly expressed as a single method in Python. > Not that it's important to the discussion, but, while Java does not have the capability to give defau

Re: Overloading Methods

2009-01-20 Thread Chris Rebert
(top-posting just for consistency) In that case, you might also be interested in: http://dirtsimple.org/2004/12/python-is-not-java.html Cheers, Chris On Tue, Jan 20, 2009 at 12:19 PM, K-Dawg wrote: > Thank you for the explanation. With my background in Java, I have to get > myself to think a l

Re: Overloading Methods

2009-01-20 Thread K-Dawg
Thank you for the explanation. With my background in Java, I have to get myself to think a little differently. Kevin On Tue, Jan 20, 2009 at 1:41 PM, Chris Rebert wrote: > On Tue, Jan 20, 2009 at 10:18 AM, MRAB wrote: > > K-Dawg wrote: > >> > >> Can you overload methods in Python? > >> > >> C

Re: Overloading Methods

2009-01-20 Thread Chris Rebert
On Tue, Jan 20, 2009 at 10:18 AM, MRAB wrote: > K-Dawg wrote: >> >> Can you overload methods in Python? >> >> Can I have multiple __inits__ with different parameters passed in? >> > Simple answer: no. More complicated answer: Yes, with some caveats. You usually don't need to overload methods in

Re: Overloading Methods

2009-01-20 Thread MRAB
K-Dawg wrote: Can you overload methods in Python? Can I have multiple __inits__ with different parameters passed in? Simple answer: no. -- http://mail.python.org/mailman/listinfo/python-list

Overloading Methods

2009-01-20 Thread K-Dawg
Can you overload methods in Python? Can I have multiple __inits__ with different parameters passed in? Thanks. Kevin -- http://mail.python.org/mailman/listinfo/python-list