Skip to content

Conversation

@gapplef
Copy link

@gapplefgapplef commented Oct 12, 2025

Fix incorrect location of positional-only parameter indicator for eval and exec in the documentation


📚 Documentation preview 📚: https://cpython-previews--139978.org.readthedocs.build/

… `exec` Fix incorrect location of positional-only parameter indicator for `eval` and `exec`
@bedevere-appbedevere-appbot added docs Documentation in the Doc dir skip news labels Oct 12, 2025
@python-cla-bot
Copy link

python-cla-botbot commented Oct 12, 2025

All commit authors signed the Contributor License Agreement.

CLA signed

@StanFromIrelandStanFromIreland changed the title Update location of positional-only parameter indicator for eval and exec in the documentationgh-131885: Update location of positional-only parameter indicator for eval and exec in the documentationOct 12, 2025
Copy link
Member

@StanFromIrelandStanFromIreland left a 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 

@StanFromIrelandStanFromIreland added the pending The issue will be closed if no feedback is provided label Oct 12, 2025
@picnixz
Copy link
Member

Closing since the current implementation accepts keyword-arguments.

@picnixzpicnixz closed this Oct 12, 2025
@gapplef
Copy link
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()

@picnixz
Copy link
Member

picnixz commented Oct 12, 2025

Python 3.13 and later. We don't update 3.12 anymore (except for security fixes).

@gapplef
Copy link
Author

OK, Thanks!

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting reviewdocsDocumentation in the Doc dirpendingThe issue will be closed if no feedback is providedskip news

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

3 participants

@gapplef@picnixz@StanFromIreland