Steven D'Aprano <steve+pyt...@pearwood.info> added the comment:

This is not a bug, this is working as the language is designed, and the 
behaviour occurs for all functions, not just class methods. Default values are 
only evaluated once, when the function is defined, not every time the function 
is called.

This is even described in the FAQs:

https://docs.python.org/3/faq/programming.html#id13

----------
nosy: +steven.daprano
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

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

Reply via email to