]> gitweb.fluxo.info Git - blog.git/commitdiff
Research: Python: handling mutables as arguments and as default arguments
authorSilvio Rhatto <rhatto@riseup.net>
Tue, 14 May 2019 22:44:04 +0000 (19:44 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Tue, 14 May 2019 22:44:04 +0000 (19:44 -0300)
research/python.md

index 40e0db5f8b73dbc8c506c5ebdef63be89e5e6d87..71f27ef9f5ec4ec49001109bb30a2cc01eafe998 100644 (file)
@@ -97,6 +97,10 @@ Python encourages polymorphism:
 So remember that when [copying](https://stackoverflow.com/questions/2612802/how-to-clone-or-copy-a-list#2612815)
 or referencing a list.
 
+Also, [take care with handling mutables as arguments and as default arguments](http://www.thedigitalcatonline.com/blog/2015/02/11/default-arguments-in-python/),
+also explained [here](https://docs.python.org/3/tutorial/controlflow.html#default-argument-values) and [here](https://docs.python-guide.org/writing/gotchas/)
+(common gotchas).
+
 ### Threads
 
 From [GlobalInterpreterLock](https://wiki.python.org/moin/GlobalInterpreterLock):