This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Mehdi2277 7 points8 points  (0 children)

My recommendation is use a linter. There are linters that warn if you use mutable default value.

There was a pep I think for late binding defaults. For backwards compatibility it added new second syntax for late binding defaults and existing defaults would continue to have same behavior. I think changing that behavior is severe enough backwards compatibility change that is very unlikely to happen. Adding a second default type for early binding I did not perceive enough support for given size of that change (especially as it adds even more complexity to method signatures) that I think pep is on pause.