Ammar Askar <am...@ammaraskar.com> added the comment:

This is a common mistake, you'll find the FAQ entry for it here: 
https://docs.python.org/3/faq/programming.html#why-are-default-values-shared-between-objects

It's not necessarily a "feature" but default values in functions are only 
created once, when the function is defined. Subsequent calls will refer to that 
same initially created object.

----------
nosy: +ammar2
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue39556>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to