Remix.run Logo
nine_k 9 days ago

I understand your concern, and I think the PEP addresses it. Quite bluntly, t"foo" is not a string, while f"foo" is. You'll get a typecheck error if you run a typechecker like any reasonable developer, and will get a runtime error if you ignore the type mismatch, because t"foo" even lacks a __str__() method.

One statement the PEP could put front and center in the abstract could be "t-strings are not strings".

guelo 9 days ago | parent | next [-]

> "t-strings are not strings"

t-string is an unfortunate name for something that is not a string.

nine_k 8 days ago | parent [-]

I wish it were called "string templates" instead, with t"whatever" form being called a "template literal".

DonHopkins 8 days ago | parent | prev [-]

Simpson's Individual Stringettes!

https://www.youtube.com/watch?v=7qNj-QFZbew

sevensor 8 days ago | parent [-]

Away with floods! Away with workaday tidal waves!