|
|
|
|
|
by kerkeslager
802 days ago
|
|
The language spec isn't right you just like it. Sure, there are a lot of subjective aesthetics that go into the spec, but in this case, there are objective reasons for not liking this. It's a well-known footgun that causes bugs. And it's almost never what you want, so you end up doing something like this: def f(xs = None):
# Are these two lines actually faster than the
# interpreter creating defaults at call time?
if xs is None:
xs = []
...
Do you have any reasons at all for defending this decision? |
|