This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author martin.panter
Recipients abarry, docs@python, eric.smith, jayvdb, martin.panter, python-dev
Date 2016-02-07.03:06:31
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1454814401.67.0.000471406931441.issue25179@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2016-02-07 03:06:42martin.pantersetrecipients: + martin.panter, eric.smith, docs@python, python-dev, jayvdb, abarry
2016-02-07 03:06:41martin.pantersetmessageid: <1454814401.67.0.000471406931441.issue25179@psf.upfronthosting.co.za>
2016-02-07 03:06:41martin.panterlinkissue25179 messages
2016-02-07 03:06:40martin.pantercreate