
On Aug 9, 2021, at 08:27, Eric V. Smith <eric@trueblade.com> wrote:
My understanding is that PEP 649 is currently in front of the SC. But do we need to have any additional discussion here? My recollection is that we backed out the PEP 563 change because we didn't feel we had enough time to come to a good decision one way or the other before 3.10.
My recollection for why the SC deferred this (other than running out of time and not wanting to make a hasty decision for 3.10) is two fold: * Should the type annotation syntax always follow Python syntax, or should we allow the type annotation syntax to deviate from “standard” Python? This also came up in the context of PEP 646, which introduces syntax for type annotations that may or may not be useful or desired for regular Python. * Should we codify current practice so that type annotations are useful and supported at both compile time and run time (e.g. the pydantic use case)? These are still open questions. While it’s interesting to entertain the separation of general Python syntax from type annotation syntax — allowing the latter to evolve more quickly and independently from the former -- ultimately I think (and my gauge of the SC sentiment is) that there’s no way this will work in practice. That means that type annotation syntax can’t be delegated and so we have to consider type-inspired syntax changes within the full context of the Python language. As for the second question, it means that we have to be very careful that the folks who use type annotation at compile/static checking time (e.g. mypy and friends) explicitly consider the existing use cases and needs of the runtime type community. These two constituents have to work together to avoid backward incompatible changes. When the SC was considering all these PEPs for 3.10, we felt like we needed clarity on the direction and purpose of type annotations before we could make decisions we’d have to live with essentially forever. Cheers, -Barry