GeezerVison is showing github.com — gh-131885: Update location of positional-only parameter indicator for `eval` and `exec` in the documentation by gapplef · Pull Request #139978 · python/cpython
Conversation
gapplef
commented
Oct 12, 2025
•
edited by bedevere-app
Bot
Loading
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
… `exec`
Fix incorrect location of positional-only parameter indicator for `eval` and `exec`
|
All commit authors signed the Contributor License Agreement.

|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
StanFromIreland
changed the title
Update location of positional-only parameter indicator for eval and exec in the documentation
gh-131885: Update location of positional-only parameter indicator for eval and exec in the documentation
Oct 12, 2025
StanFromIreland
left a comment
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is wrong since 2770d5c (see versionchanged notes).
For example, globals can be passed as a positional argument:
>>> eval("x + 1", {'x': 1})
2
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Closing since the current implementation accepts keyword-arguments.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
@picnixz May I ask which version you've tested?
>>> import sys
>>> 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 (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: eval() takes no keyword arguments
>>> exec( "x + 1", globals={'x': 1})
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: 'globals' is an invalid keyword argument for exec()
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
picnixz
commented
Oct 12, 2025
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
|
Python 3.13 and later. We don't update 3.12 anymore (except for security fixes).
|
StanFromIreland and gapplef reacted with thumbs up emoji
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
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.
|