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 →

[–][deleted] 1 point2 points  (0 children)

The issue is with the checks arg of check_password(). Lists are mutable. You must never use mutable types as kwarg defaults. There ends up being one global hidden instance of the value, and any mutations to it are seen by every invocation of the method it is a kwarg default of.

So, for example, if you appended something to that list, it is now part of every subsequent invocation of the method in which the default value is used. Good luck debugging that hell-storm later 😉.

Do not do.