Default method arguments
Bill Mill
bill.mill at gmail.com
Tue Nov 15 11:28:24 EST 2005
On 11/15/05, Nicola Larosa <nico-NoSp at m-teknico.net> wrote:
> > def f(self, x=None):
> > if not x:
>
> Ha! You fell for it! ;-D
> (Hint: what about x being passed with a value of zero? :-) )
I wasn't sure if you saw my post before you posted - good call. I just
tossed off an answer without thinking much, and we see the result. It
could have been a good debugging lesson for him if he'd tried to pass
0; I think I'll use that as my excuse.
Peace
Bill Mill
bill.mill at gmail.com
More information about the Python-list
mailing list