-
-
Notifications
You must be signed in to change notification settings - Fork 33k
gh-138558: Improve description of Interpolation.expression
in library docs
#139187
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
base: main
Are you sure you want to change the base?
Conversation
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.
Some suggestions -- these will need wrapping though, sorry, I'm on mobile.
A
Doc/library/string.templatelib.rst
Outdated
should either set this to an empty string or choose a suitable valid | ||
Python expression. | ||
For interpolations created from t-string literals, :attr:`!expression` | ||
is the source text found inside the curly braces, including any |
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.
is the source text found inside the curly braces, including any | |
is the source text found inside the curly brackets (``{`` & ``}``), including any |
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.
Aren't they "curly braces", not "brackets"?
(Or is there some python doc standard here?)
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.
Update: haha, I checked, and it looks like there's no consistency even in the Python docs.
Here's a google search for "curly braces" in Python docs vs same search for "curly brackets"
Top Google hit for "curly braces" in the docs is inside Format String Syntax
Top Google hit for "curly brackets" in the docs is in the index itself
Happy to go either way here! 🤷🏻♂️
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.
Doc/library/string.templatelib.rst
Outdated
Python expression. | ||
For interpolations created from t-string literals, :attr:`!expression` | ||
is the source text found inside the curly braces, including any | ||
whitespace, but excluding the curly braces themselves. For manually |
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.
whitespace, but excluding the curly braces themselves. For manually | |
whitespace, but excluding the curly brackets themselves. For manually |
Co-authored-by: Adam Turner <[email protected]>
…nto interpolation-doc-fix
Thanks! Applied all of them but waiting for your final input on "curly braces" vs "curly brackets" since the docs seem inconsistent on 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.
LGTM!
Improve the description of
Interpolation.expression
to clarify exactly what it is set to, and when.This is in response to Jelle's comment in this related issue.
📚 Documentation preview 📚: https://cpython-previews--139187.org.readthedocs.build/