1
0
mirror of https://github.com/satwikkansal/wtfpython synced 2024-11-22 02:54:25 +01:00

Merge pull request #178 from larsks/fix/bad-logic

Fixed logic error in "Beware of default mutable arguments!"
This commit is contained in:
Satwik Kansal 2020-01-20 14:18:41 +05:30 committed by GitHub
commit 8e6c850f30
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

2
README.md vendored
View File

@ -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