[issue42379] Optional List Args Persist Across Objects

Steven D'Aprano report at bugs.python.org
Mon Nov 16 16:22:34 EST 2020


Steven D'Aprano <steve+python at pearwood.info> added the comment:

Hi Rose, this is a FAQ:

https://docs.python.org/3/faq/programming.html#why-are-default-values-shared-between-objects

although it's also a feature that does cause beginners some trouble, see for example my comment here for more information:

https://bugs.python.org/msg361451

----------
nosy: +steven.daprano

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue42379>
_______________________________________


More information about the Python-bugs-list mailing list