Default method arguments

Nicola Larosa nico-NoSp at m-tekNico.net
Tue Nov 15 11:20:29 EST 2005


>     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? :-) )

>             x = self.data
>         print x

-- 
Nicola Larosa - nico-NoSp at m-tekNico.net

...Linux security has been better than many rivals. However, even
the best systems today are totally inadequate. Saying Linux is
more secure than Windows isn't really addressing the bigger issue
 - neither is good enough. -- Alan Cox, September 2005



More information about the Python-list mailing list