Skip to content

Nested arguments in str.format #1707

@pohmelie

Description

@pohmelie

micropython:

>>> str.format("{text:{align}{width}}", text="foo", align="^", width=20)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: invalid format specifier

cpython 3.4.3:

>>> str.format("{text:{align}{width}}", text="foo", align="^", width=20)
'        foo         '

I read #407 and #574 (as wiki said). I understand, that core contributors probably don't like str.format and str.format not fully supported, but I prefer this method of string formatting and want this to be implemented.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions