This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients Mark.Shannon, brett.cannon, gvanrossum, petr.viktorin, rhettinger, serhiy.storchaka, vstinner, yselivanov
Date 2021-02-20.12:14:33
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1613823273.49.0.304650831422.issue42990@roundup.psfhosted.org>
In-reply-to
Content
> Regarding the text in What's New 3.10 about this at https://docs.python.org/dev/whatsnew/3.10.html#other-language-changes, I recommend adding there that func.__builtins__ is initialized from globals["__builtins__"], if it exists, else from the frame's builtins, when the function object is created; like you state in https://github.com/python/cpython/pull/24564.

Good idea, I updated my PR.

> Or perhaps make one of these paragraphs refer to the other for details, since they are duplicate mentions of the same behavior change (once the latter PR lands).

IMO it's useful to have two different paragraphs. One about the new attribute which is not really a semantics change, and one about the semantics changes when globals["__builtins__"] doesn't exist. For people who only care about Python 3.10 incompatible changes, they can simply read the Porting to Python 3.10 > Changes in the Python API section ;-)
History
Date User Action Args
2021-02-20 12:14:33vstinnersetrecipients: + vstinner, gvanrossum, brett.cannon, rhettinger, petr.viktorin, Mark.Shannon, serhiy.storchaka, yselivanov
2021-02-20 12:14:33vstinnersetmessageid: <1613823273.49.0.304650831422.issue42990@roundup.psfhosted.org>
2021-02-20 12:14:33vstinnerlinkissue42990 messages
2021-02-20 12:14:33vstinnercreate