Skip to content

Error in description of f-string "=" functionality #125496

@ericvsmith

Description

@ericvsmith

https://docs.python.org/3/reference/lexical_analysis.html#f-strings

The description of the "=" functionality says:

By default, the '=' causes the repr() of the expression to be provided, unless there is a format specified. When a format is specified it defaults to the str() of the expression unless a conversion '!r' is declared.

But that's not correct. If a format is specified, it uses value.__format__(format_spec).

I'll produce a patch.

Metadata

Metadata

Assignees

Labels

docsDocumentation in the Doc dirinterpreter-core(Objects, Python, Grammar, and Parser dirs)

Projects

Status

Todo

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions