Skip to content

gh-148942: Docs: Clarify that exec() accepts bytes-like objects#148943

Open
goroshirow wants to merge 5 commits intopython:mainfrom
goroshirow:patch-1
Open

gh-148942: Docs: Clarify that exec() accepts bytes-like objects#148943
goroshirow wants to merge 5 commits intopython:mainfrom
goroshirow:patch-1

Conversation

@goroshirow
Copy link
Copy Markdown

@goroshirow goroshirow commented Apr 24, 2026

Update the documentation for exec() to explicitly state that source can be a bytes-like object. This matches the actual implementation and restores clarity. Also updated the subsequent sentence to maintain logical consistency.


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

Update the documentation for `exec()` to explicitly state that `source` can be a bytes-like object.
This matches the actual implementation and restores clarity.
Also updated the subsequent sentence to maintain logical consistency.
@python-cla-bot
Copy link
Copy Markdown

python-cla-bot Bot commented Apr 24, 2026

All commit authors signed the Contributor License Agreement.

CLA signed

@picnixz
Copy link
Copy Markdown
Member

picnixz commented Apr 24, 2026

  1. Can you avoid reflowing the paragraphs if possible to minimize the diff?
  2. Should eval() docs be also updated?

- Revert paragraph reflowing in exec() docs.
- Update eval() documentation to clarify it accepts a bytes-like object.
@goroshirow
Copy link
Copy Markdown
Author

Thank you for the review. I have updated the PR to address your comments:

  1. Reverted the paragraph reflowing to minimize the diff.
  2. Updated the eval() documentation to include bytes-like objects as suggested.

Copy link
Copy Markdown
Member

@picnixz picnixz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah I see why you reflowed the paragraph. Here's a suggestion to reduce the diff while keeping the lines under 80 chars.

Comment thread Doc/library/functions.rst Outdated
Comment thread Doc/library/functions.rst Outdated
Comment thread Doc/library/functions.rst Outdated
goroshirow and others added 3 commits April 24, 2026 22:16
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
@goroshirow
Copy link
Copy Markdown
Author

Thanks for the review and the suggestion.
I've applied the fix.

@picnixz picnixz added needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes labels Apr 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting merge docs Documentation in the Doc dir needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes skip news

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

2 participants