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.

classification
Title: Format Spec example says limited to 3.1+ but works in 2.7
Type: Stage: resolved
Components: Documentation Versions: Python 3.8, Python 3.7, Python 3.6, Python 3.4, Python 3.5
process
Status: closed Resolution:
Dependencies: Superseder:
Assigned To: docs@python Nosy List: docs@python, fdrake, mlm
Priority: normal Keywords:

Created on 2019-01-26 04:06 by mlm, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Messages (2)
msg334385 - (view) Author: Mitchell L Model (mlm) Date: 2019-01-26 04:06
https://docs.python.org/3/library/string.html#format-examples includes this line:

    '{}, {}, {}'.format('a', 'b', 'c')  # 3.1+ only

This does in fact work in 2.7. I don't see anything special about this -- seems an entirely straightforward format.
msg334386 - (view) Author: Fred Drake (fdrake) (Python committer) Date: 2019-01-26 04:12
The 3.X docs generally don't refer to the 2.X series.

What that comment is pointing out is that leaving the field identifier out (the number inside the {...} placeholder syntax) was not in the 3.0, but added in 3.1.

Unfortunately, I don't have a 3.0 interpreter available to show the exception that's raised.

No change is required.
History
Date User Action Args
2022-04-11 14:59:10adminsetgithub: 80012
2019-01-26 04:12:43fdrakesetstatus: open -> closed

nosy: + fdrake
messages: + msg334386

stage: resolved
2019-01-26 04:06:30mlmsetassignee: docs@python

components: + Documentation
nosy: + docs@python
2019-01-26 04:06:00mlmcreate