r/Python • u/[deleted] • Jul 22 '21
Resource Do not use mutable objects as default arguments in Python
https://medium.com/geekculture/do-not-use-objects-as-default-arguments-in-python-1c940212db2e
1.3k
Upvotes
r/Python • u/[deleted] • Jul 22 '21
1
u/BeKenny Jul 22 '21
How is something built into the language a non issue? The reason people would do it this way is because they can and they didn't learn otherwise. You can make an argument for never using default arguments ever if you'd like, but no need to be condescending.