[Python-Dev] f-strings (original) (raw)

Chris Barker chris.barker at noaa.gov
Tue Dec 19 15:32:03 EST 2017


On Tue, Dec 19, 2017 at 8:47 AM, Stephen J. Turnbull < turnbull.stephen.fw at u.tsukuba.ac.jp> wrote:

I don't see any reason not to document tips and tricks with f-strings, and this is a nice and useful example. But it looks like TOOWTDI to me. The syntax is documented (6.1.3.1 in the Library Reference), along with a specific relevant example ("Aligning the text and specifying a width" in 6.1.3.2).

So -1 on putting the recipe in the reference docs. I really don't think this kind of information belongs in a PEP for sure, and probably not even in the Library Reference.

The docs (and I think PEP) have been updated to clearly state that f-strings use the same formatting specifiers as .format(), and have links to those docs.

So I think we're good.

The Tutorial might be a good place for it, though.

yup.

-CHB

--

Christopher Barker, Ph.D. Oceanographer

Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker at noaa.gov -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/python-dev/attachments/20171219/e2e9a4d6/attachment-0001.html>



More information about the Python-Dev mailing list