Re:Anti-Patterns in Python Programming
by hueving on Thursday July 10, 2014 @04:49AM
(#8014237)
It's not broken when you understand that functions are objects and default parameters are just members of those objects. Each time the function is executed you get local vars that point to these object members. If one is a mutable type, any changes you make to it will then obviously persist.
[ Parent
| on HN ]
It leaves me wondering, are the parameters also scoped to the class(seeing as they're declared at the same time)? Wouldn't this cause an issue with concurrent access to the function?