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
>
> 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
(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
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
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
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
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