Is it explicitly specified?

Steven D'Aprano steve at REMOVE-THIS-cybersource.com.au
Mon Feb 4 06:05:15 EST 2008


On Sun, 03 Feb 2008 15:31:49 -0800, Paul Boddie wrote:

> I don't know whether I can offer much better advice than others, but I
> have noticed that a lot of my own code has moved in the direction of not
> having specific default values in function/method signatures. So,
> instead of this...
> 
>   def f(x=123):
>     ...
> 
> ...I have this:
> 
>   def f(x=None):
>     if x is None:
>       x = 123


For the love of Pete, WHY??????

I understand why you would do it for a mutable default, but immutable???




-- 
Steven



More information about the Python-list mailing list