Uh oh!
There was an error while loading. Please reload this page.
gh-131885: Update location of positional-only parameter indicator for eval and exec in the documentation - #139978
Closed
gapplef wants to merge 1 commit into
Closed
gh-131885: Update location of positional-only parameter indicator for eval and exec in the documentation#139978gapplef wants to merge 1 commit into
eval and exec in the documentation#139978gapplef wants to merge 1 commit into
Conversation
… `exec` Fix incorrect location of positional-only parameter indicator for `eval` and `exec`
eval and exec in the documentationeval and exec in the documentation5 tasks
Member
There was a problem hiding this comment.
This is wrong since 2770d5c (see versionchanged notes).
For example, globals can be passed as a positional argument:
>>> eval("x + 1", {'x': 1})
2
picnixz
commented
Oct 12, 2025
Member
Closing since the current implementation accepts keyword-arguments. |
gapplef
commented
Oct 12, 2025
Author
@picnixz May I ask which version you've tested? >>>importsys>>>sys.version'3.12.11 | packaged by conda-forge | (main, Jun 4 2025, 14:45:31) [GCC 13.3.0]'>>>eval( "x + 1", globals={'x': 1})
Traceback (mostrecentcalllast):
File"<stdin>", line1, in<module>TypeError: eval() takesnokeywordarguments>>>exec( "x + 1", globals={'x': 1})
Traceback (mostrecentcalllast):
File"<stdin>", line1, in<module>TypeError: 'globals'isaninvalidkeywordargumentforexec() |
Member
Python 3.13 and later. We don't update 3.12 anymore (except for security fixes). |
gapplef
commented
Oct 12, 2025
Author
OK, Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix incorrect location of positional-only parameter indicator for
evalandexecin the documentation📚 Documentation preview 📚: https://cpython-previews--139978.org.readthedocs.build/
*and/as needed #131885