Post #2476225
2026-05-02 13:44 UTC
@hugovk@mastodon.social @brass75@twit.social @stylus@social.afront.org
Triggered by this post:
https://mastodon.social/@grant_h/116504261915412452
Parts of the thread were 'followers only'
The essence:
tylus@social.afront.org
@grant_h@mastodon.social @brass75 function default arguments are evaluated when the function definition is encountered, not each time it's called. https://
peps.python.org/pep-0671/ seeks to add an alternative behavior ...
We were wondering how to get some support for PEP 671, since it seems to give a neat way of avoiding a common footgun?
Replies (1)
-
@hugovk@mastodon.social 2026-05-02 14:04
@grant_h@mastodon.social @brass75@twit.social @stylus@social.afront.org Right, by all means open a new topic at https://discuss.python.org/c/ideas/6 about reviving it. I suggest reviewing the previous python-ideas threads from 2021 first, and addressing any major concerns raised there. The PEP is still in draft, so in theory could be revived, although in practice it may be better to write a fresh PEP. (Then again, PEP 661 was recently revived and just got merged for 3.15!) The original author is active on Discourse so I expect he'll reply.