/top/
/new/
/best/
/ask/
/show/
/job/
^
slacker news
login
about
←back to thread
Python’s new t-strings
(davepeck.org)
620 points
tambourine_man
| 1 comments |
21 Apr 25 04:31 UTC
|
HN request time: 0.001s
|
source
Show context
fph
◴[
21 Apr 25 09:47 UTC
]
No.
43750052
[source]
▶
>>43748512 (OP)
#
How do these interact with i18n? Can I load a translated t-string with `_(t"")` from a .po file? Can it include variable names and arbitrary code inside lambdas?
replies(1):
>>43751188
#
1.
nhumrich
◴[
21 Apr 25 12:28 UTC
]
No.
43751188
[source]
▶
>>43750052
#
I suggest you read the PEP, there is a section on i18n. Short version is it's not designed for this use case.
As for variables and arbitrary code/lambdas, yes: t-strings can do that, just like f-strings
ID:
GO
↑