Thanks for writing this up! It's a great step forward.

A few quick comments:

- It's a very ambitious proposal, which increases the risk that it gets bogged down due to some small aspect. Concretely, perhaps default values for TypeVars should be saved for another PEP; I know there's already a draft PEP for that feature floating around.
- The idea of adding a new lexical scope is clever but may lead to a rabbit hole of runtime subtleties, especially for classes nested in functions. An alternative approach could use an implicit `del` for names defined as TypeVars, similar to the way except blocks work.
- "A duplicate name generates a syntax error at runtime" -> should be "compile time"

El lun, 20 jun 2022 a las 0:28, Eric Traut (<>) escribió:
In last month's typing meetup, Sebastian presented some options for improving the syntax for type parameters. I subsequently posted some slides that explored a bunch of options. For reference, here's a link to those slides:

In the interest of continuing to make progress on this topic, I've drafted a PEP that places some stakes in the ground. Here's a link to the PEP: I'm interested in feedback.

Since there appears to be broad interest in addressing this problem, perhaps we can use the next typing meetup to continue this discussion.


Eric Traut
Contributor to Pyright & Pylance
Typing-sig mailing list --
To unsubscribe send an email to
Member address: