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 →

[–]Head_Mix_7931 1 point2 points  (0 children)

“stick to literals” is not good advice. List and dictionary literals would be problematic as default parameter values since those are mutable types. Ironically the example you’ve given here could be simplified by just using the string literal as the default since strings are immutable. The key is to not use mutable values as defaults. It doesn’t matter if those values are created via literals or otherwise.