←back to thread

620 points tambourine_man | 1 comments | | HN request time: 0.212s | source
Show context
kamikaz1k ◴[] No.43753964[source]
by making it a generic `t` you lose explicit syntax highlighting. Where something like JS template`string` could determine which syntax to use based on the template value.

I supposed when assigning it to a, variable: SyntaxRecognizableTemplate, you could give it the hint necessary.

was this discussed in the PEP?

*edit: reading the PEP-750[1] it doesn't seem like it..

[1] https://peps.python.org/pep-0750/#the-interpolation-type

replies(2): >>43754598 #>>43754660 #
1. pauleveritt ◴[] No.43754660[source]
It was discussed in the first revision and discussion of the PEP. The decision was made to move that to follow-on work, as we discovered more about what tooling needs.

As an example, I was excited about using `Annotated` on the function to indicate the language it expected. Turns out, a lot of linters know nothing about the type system.