3 ms·
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 t
by nine_k 2y 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 2y ago> "t-strings are not strings" t-string is an unfortunate name for something that is not a string.
- nine_k 2y agoI wish it were called "string templates" instead, with t"whatever" form being called a "template literal".
- DonHopkins 2y agoSimpson's Individual Stringettes! https://www.youtube.com/watch?v=7qNj-QFZbew https://www.youtube.com/watch?v=7qNj-QFZbew
- sevensor 2y agoAway with floods! Away with workaday tidal waves!