Skip to content

Conversation

@vstinner
Copy link
Member

@vstinner vstinner commented Feb 17, 2021

Expose the new PyFunctionObject.func_builtins member in Python as a
new __builtins__ attribute on functions.

Document also the behavior change in What's New in Python 3.10.

https://bugs.python.org/issue42990

Expose the new PyFunctionObject.func_builtins member in Python as a
new __builtins__ attribute on functions.

Document also the behavior change in What's New in Python 3.10.
@vstinner
Copy link
Member Author

@markshannon: I wrote this PR to expose the new function attribute in Python but also to document the subtle behavior change.

Using the new attribute, cloudpickle will be able to hack the function builtins update the update method, as already done for function globals.

@markshannon
Copy link
Member

LGTM

@vstinner vstinner merged commit a3c3ffa into python:master Feb 18, 2021
@vstinner vstinner deleted the func_builtins branch February 18, 2021 11:35
adorilson pushed a commit to adorilson/cpython that referenced this pull request Mar 13, 2021
Expose the new PyFunctionObject.func_builtins member in Python as a
new __builtins__ attribute on functions.

Document also the behavior change in What's New in Python 3.10.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants