Message259757
Regarding doc strings, it seems that a constant f-string without any interpolations does become a doc string. But I would treat this as an implementation detail, not something to advertise.
Attached is my attempt at a patch. Please have a look and let me know if there are things I missed, if I added too much detail, wrong terminology, or whatever. I haven’t really written documentation like this before.
The combinations and permutations of all the Fr". . ." prefixes are getting borderline out of hand in the lexical_analysis.rst grammar. Any suggestions?
I put the bulk of the documentation in a new section “Formatted string literals” of the Lexical Analysis chapter, the same place that describes escape sequences and raw strings. Let me know if there is a more appropriate place for it. It doesn’t feel quite right where it is because this chapter comes before Expressions, and f-strings use expressions inside them.
I also made minimal changes to existing parts of the documentation and tutorial, to point to the new documentation. Perhaps some code examples could be changed from str.format() to f". . .", but I think that would be the subject of a separate patch. There are even places that still use the outdated "{0}".format() numbering. |
|
Date |
User |
Action |
Args |
2016-02-07 03:06:42 | martin.panter | set | recipients:
+ martin.panter, eric.smith, docs@python, python-dev, jayvdb, abarry |
2016-02-07 03:06:41 | martin.panter | set | messageid: <1454814401.67.0.000471406931441.issue25179@psf.upfronthosting.co.za> |
2016-02-07 03:06:41 | martin.panter | link | issue25179 messages |
2016-02-07 03:06:40 | martin.panter | create | |
|