bpo-29928: Add f-string to the Glossary#864
Conversation
|
@Mariatta, thanks for your PR! By analyzing the history of the files in this pull request, we identified @birkenfeld, @benjaminp and @tiran to be potential reviewers. |
Doc/glossary.rst
Outdated
| core and with user code. | ||
|
|
||
| f-string | ||
| Short for :dfn:`formatted string literal`, which is string literal |
Doc/glossary.rst
Outdated
|
|
||
| f-string | ||
| Short for :dfn:`formatted string literal`, which is string literal | ||
| that is prefixed with ``'f'`` or ``'F'``. f-strings contain |
There was a problem hiding this comment.
Start sentence with a capital letter: F-strings contain . . .
There was a problem hiding this comment.
Hmm.. I followed PEP 498 where it is not capitalized. https://github.com/python/peps/blob/master/pep-0498.txt#L29
Should the PEP be updated?
Doc/glossary.rst
Outdated
| "He said his name is 'Fred'." | ||
|
|
||
| See also :pep:`498`, the proposal that added formatted string literals, | ||
| and the :ref:`documentation <f-strings>`. |
There was a problem hiding this comment.
While this looks good to me would it maybe be better to switch the links around and send people to the docs first and the pep later? I.e something like:
"For more information, see the :ref:documentation on f-strings <f-strings> and :pep:498, the proposal that added them."
What do you think?
rhettinger
left a comment
There was a problem hiding this comment.
Please make this entry as brief as possible. The glossary is a quick term reference, tutorial, or primary source. The best of the glossary entires are short and sweet. Your original wording was closer to the mark. Try something like: String literals prefixed with f or F are commonly called "f-strings" which is short for :dfn:formatted string literal. See also :ref:f-strings <f-strings> and :pep:498.
|
Thanks @rhettinger :) I updated this based on your suggestion. |
Doc/glossary.rst
Outdated
|
|
||
| f-string | ||
| String literals prefixed with f or F are commonly called "f-strings" | ||
| which is short for :dfn:`formatted string literal`. See also |
There was a problem hiding this comment.
This isn't the definition of "formatted string literal" (:dfn: is used for formatting term definitions). The reference "See also f-strings" looks self-recursive.
I think it would be better to write which is short for :ref:'formatted string literal <f-strings>'.
|
Thanks all :) |
(cherry picked from commit 33db068)
No description provided.