mirror of
https://github.com/satwikkansal/wtfpython
synced 2025-07-04 20:38:06 +02:00
Merge pull request #178 from larsks/fix/bad-logic
Fixed logic error in "Beware of default mutable arguments!"
This commit is contained in:
commit
8e6c850f30
1 changed files with 1 additions and 1 deletions
2
README.md
vendored
2
README.md
vendored
|
@ -2241,7 +2241,7 @@ def some_func(default_arg=[]):
|
|||
|
||||
```py
|
||||
def some_func(default_arg=None):
|
||||
if default_arg is not None:
|
||||
if default_arg is None:
|
||||
default_arg = []
|
||||
default_arg.append("some_string")
|
||||
return default_arg
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue