Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Format Spec example says limited to 3.1+ but works in 2.7 #80012

Closed
mlm mannequin opened this issue Jan 26, 2019 · 2 comments
Closed

Format Spec example says limited to 3.1+ but works in 2.7 #80012

mlm mannequin opened this issue Jan 26, 2019 · 2 comments
Labels
3.7 (EOL) end of life 3.8 only security fixes docs Documentation in the Doc dir

Comments

@mlm
Copy link
Mannequin

mlm mannequin commented Jan 26, 2019

BPO 35831
Nosy @freddrake

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = <Date 2019-01-26.04:12:43.274>
created_at = <Date 2019-01-26.04:06:00.716>
labels = ['3.7', '3.8', 'docs']
title = 'Format Spec example says limited to 3.1+ but works in 2.7'
updated_at = <Date 2019-01-26.04:12:43.272>
user = 'https://bugs.python.org/mlm'

bugs.python.org fields:

activity = <Date 2019-01-26.04:12:43.272>
actor = 'fdrake'
assignee = 'docs@python'
closed = True
closed_date = <Date 2019-01-26.04:12:43.274>
closer = 'fdrake'
components = ['Documentation']
creation = <Date 2019-01-26.04:06:00.716>
creator = 'mlm'
dependencies = []
files = []
hgrepos = []
issue_num = 35831
keywords = []
message_count = 2.0
messages = ['334385', '334386']
nosy_count = 3.0
nosy_names = ['fdrake', 'mlm', 'docs@python']
pr_nums = []
priority = 'normal'
resolution = None
stage = 'resolved'
status = 'closed'
superseder = None
type = None
url = 'https://bugs.python.org/issue35831'
versions = ['Python 3.4', 'Python 3.5', 'Python 3.6', 'Python 3.7', 'Python 3.8']

@mlm
Copy link
Mannequin Author

mlm mannequin commented Jan 26, 2019

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.

@mlm mlm mannequin added 3.7 (EOL) end of life 3.8 only security fixes docs Documentation in the Doc dir labels Jan 26, 2019
@mlm mlm mannequin assigned docspython Jan 26, 2019
@freddrake
Copy link
Member

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.

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.7 (EOL) end of life 3.8 only security fixes docs Documentation in the Doc dir
Projects
None yet
Development

No branches or pull requests

1 participant