-
-
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?
Changes from 1 commit
f6cb83c
44ea6c3
ca45cd1
f38b43e
86f0c44
2061750
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -258,13 +258,14 @@ Types | |||||
.. attribute:: expression | ||||||
:type: str | ||||||
|
||||||
The text of a valid Python expression, or an empty string. | ||||||
|
||||||
The :attr:`.expression` is the original text of the | ||||||
interpolation's Python expression, if the interpolation was created | ||||||
from a t-string literal. Developers creating interpolations manually | ||||||
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 | ||||||
|
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.
Outdated
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 |
Uh oh!
There was an error while loading. Please reload this page.