New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gh-78612: Mark up eval() using param list #115212
Conversation
Also mention that the *expression* parameter can be a string.
Competing PR to #20000 |
The arguments are a string and optional globals and locals. If provided, | ||
*globals* must be a dictionary. If provided, *locals* can be any mapping | ||
object. | ||
:param expression: |
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 currently the only function in the page to use :param:
. Are you planning to update some/all the others as well?
If not, I think it might be better to keep the original paragraph. Mentioning that it accepts code objects and adding links to that and to "mapping" are good changes.
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.
I don't think it matters that only one function is marked up better. In any case, there are other good candidates:
compile()
exec()
open()
print()
__import__()
Possibly also:
setattr()
sorted()
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.
FTR, I'd suggest adapting one at the time.
This comment was marked as resolved.
This comment was marked as resolved.
:returns: The result of the evaluated expression. | ||
:raises: Syntax errors are reported as exceptions. |
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.
These two sentences were copied verbatim from the original text. I don't think it makes sense to expand the scope of this PR to include tweaking the wording in these two sentences.
@iritkatriel, are you interested in reviewing this? |
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.
Let's perhaps move this PR forward to merge. We can get folks' feedback at the next docs meeting on the formatting.
I'm fine with that. @CAM-Gerlach suggested broadcasting this change to a wider audience, and I think that's a good idea; I just don't have the available time to start (and continue to follow) such a discussion right now. If you're fine with trying this out and discussing it at the next docs meeting, I'm fine with that. (If we don't like it, we can revert 🙂) |
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.
Thanks for chiming in, everyone. We'll land this now and discuss the change at the upcoming docs meetup (2024-03-05). |
Thanks @erlend-aasland for the PR 🌮🎉.. I'm working now to backport this PR to: 3.11, 3.12. |
Also mention that the 'expression' parameter can be a string. (cherry picked from commit a71e32c) Co-authored-by: Erlend E. Aasland <erlend@python.org>
GH-116044 is a backport of this pull request to the 3.12 branch. |
Also mention that the 'expression' parameter can be a string. (cherry picked from commit a71e32c) Co-authored-by: Erlend E. Aasland <erlend@python.org>
GH-116045 is a backport of this pull request to the 3.11 branch. |
Let's hold the backports until after the docs meeting. |
Also mention that the 'expression' parameter can be a string.
Also mention that the 'expression' parameter can be a string.
Also mention that the 'expression' parameter can be a string.
Also mention that the expression parameter can be a string.
📚 Documentation preview 📚: https://cpython-previews--115212.org.readthedocs.build/en/115212/library/functions.html#eval