classification
Title: Typo in f-string example in docs
Type: enhancement Stage: resolved
Components: Documentation Versions: Python 3.7, Python 3.6
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: docs@python Nosy List: Mariatta, cheryl.sabella, docs@python, ned.deily, vstinner
Priority: normal Keywords: patch

Created on 2018-01-31 20:56 by cheryl.sabella, last changed 2018-01-31 23:33 by ned.deily. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 5464 merged cheryl.sabella, 2018-01-31 20:57
PR 5465 merged miss-islington, 2018-01-31 21:38
Messages (7)
msg311371 - (view) Author: Cheryl Sabella (cheryl.sabella) * (Python committer) Date: 2018-01-31 20:56
On the lexical analysis doc page, in f-strings example, the following example isn't quite right:

>>> f"{today:%b %d, %Y}"  # using date format specifier
'January 27, 2017'

Submitting a patch shortly to use %B instead of %b.
msg311375 - (view) Author: Mariatta (Mariatta) * (Python committer) Date: 2018-01-31 21:13
Good catch!

I checked my presentation slides (where this example comes from).
It appeared that I meant it as %b, so the output should have been `Jan` instead of `January`.

But no strong preference, the idea is to demonstrate how to use the specifier, so %B works too.
msg311376 - (view) Author: Mariatta (Mariatta) * (Python committer) Date: 2018-01-31 21:37
New changeset b299393cc372f3ecbef4304f8eaa4c7838e975ca by Mariatta (Cheryl Sabella) in branch 'master':
bpo-32735: Fix typo in f-strings datetime format specifier example (GH-5464)
https://github.com/python/cpython/commit/b299393cc372f3ecbef4304f8eaa4c7838e975ca
msg311379 - (view) Author: Mariatta (Mariatta) * (Python committer) Date: 2018-01-31 22:17
New changeset 581ce25e1ffa374e62547ef266b6326bee0c54e5 by Mariatta (Miss Islington (bot)) in branch '3.6':
bpo-32735: Fix typo in f-strings datetime format specifier example (GH-5464) (GH-5465)
https://github.com/python/cpython/commit/581ce25e1ffa374e62547ef266b6326bee0c54e5
msg311380 - (view) Author: Mariatta (Mariatta) * (Python committer) Date: 2018-01-31 22:20
Thanks!
msg311381 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2018-01-31 22:29
@Cheryl: I concur with Mariatta, good catch, thanks!
msg311389 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2018-01-31 23:33
New changeset 70e304252af34dfde3d89c9a1aa48c0c4af17dd3 by Ned Deily (Cheryl Sabella) in branch '3.7':
bpo-32735: Fix typo in f-strings datetime format specifier example (GH-5464)
https://github.com/python/cpython/commit/70e304252af34dfde3d89c9a1aa48c0c4af17dd3
History
Date User Action Args
2018-01-31 23:33:10ned.deilysetnosy: + ned.deily
messages: + msg311389
2018-01-31 22:29:34vstinnersetnosy: + vstinner
messages: + msg311381
2018-01-31 22:20:21Mariattasetmessages: + msg311380
2018-01-31 22:20:15Mariattasetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2018-01-31 22:17:10Mariattasetmessages: + msg311379
2018-01-31 21:38:02miss-islingtonsetpull_requests: + pull_request5291
2018-01-31 21:37:59Mariattasetmessages: + msg311376
2018-01-31 21:13:38Mariattasetnosy: + Mariatta

messages: + msg311375
versions: + Python 3.6
2018-01-31 20:57:18cheryl.sabellasetkeywords: + patch
stage: patch review
pull_requests: + pull_request5290
2018-01-31 20:56:00cheryl.sabellacreate