STINNER Victor <vstin...@python.org> added the comment:

> 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 ;-)

----------

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

Reply via email to