-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Add string.templatelib
in 3.14
#14044
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
Conversation
2299f93
to
c3036f7
Compare
This comment has been minimized.
This comment has been minimized.
|
||
@final | ||
class Interpolation: | ||
value: Any # TODO: consider making `Interpolation` generic in runtime |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should also consider making Template
generic over a TypeVarTuple
. I think being able to have values
return the proper types is quite valuable. (Of course, this needs some special coding by type checkers, but template strings will need that anyway.)
class Interpolation: | ||
value: Any # TODO: consider making `Interpolation` generic in runtime | ||
expression: str | ||
conversion: Literal["a", "r", "s"] | None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mini rant: Why they used these arcane letters instead of just "repr"
, "str"
, and "ascii"
is beyond me.
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |
I created python/cpython#133970 |
No description provided.