Skip to content

Add a new attribute to create the Template #137442

@Locked-chess-official

Description

@Locked-chess-official

Feature or enhancement

Proposal:

Here is my idea

str.template(*args, **kwargs) -> Template

For example:
"{0} {2} {1}".template(x1, x2, x3)
is same to:
t"{x1} {x3} {x2}"
The usage is same to str.format, and the result is same to t-string.
Sometimes separate the string and the variables can make the code easier to check.

Has this already been discussed elsewhere?

No response given

Links to previous discussion of this feature:

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    type-featureA feature request or enhancement

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions