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 (<eric@traut.com>) 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: https://docs.google.com/presentation/d/1aVHTaj8zGYAvM27uft1ktdthwEKO4KH4qaRv... .
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: https://github.com/erictraut/peps/blob/typeparams/pep-9999.rst. 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 Microsoft _______________________________________________ Typing-sig mailing list -- typing-sig@python.org To unsubscribe send an email to typing-sig-leave@python.org https://mail.python.org/mailman3/lists/typing-sig.python.org/ Member address: jelle.zijlstra@gmail.com