←back to thread

620 points tambourine_man | 4 comments | | HN request time: 0.88s | source
Show context
enescakir ◴[] No.43749266[source]
Not sure about introducing yet another string prefix. Between f-strings, raw strings, and i18n stuff, it’s already getting crowded. Curious how readable this will be in large codebases.
replies(3): >>43749334 #>>43749489 #>>43749515 #
1. albert_e ◴[] No.43749515[source]
"Yet another" is not my main worry

The concept of prefixes itself feels a little deviant from readable code that is close to human language -- which is the spirit of Python

replies(3): >>43749659 #>>43749755 #>>43749968 #
2. Timwi ◴[] No.43749659[source]
The single letter f or t does make it unnatural to read, but if it were sql"..." or html"...", I think that would help with that.
3. empiko ◴[] No.43749755[source]
Additionally, it will probably be confusing that it is called a t-string but it is actually a constructor for a Template object and not string at all. I would rather see a new special term `template` than this.
4. toxik ◴[] No.43749968[source]
Should have been a keyword.

    a = template "foo {bar}"
As should raw and format.