I've read the recent discussions regarding PEP 649 and PEP 563 with interest, Larry Hastings recently contacted me when prompted to do so in a related discussion.
I maintain
pydantic which uses type annotations to provide runtime data validation.
I'm extremely worried that if PEP 649 gets rejected, pydantic will not be able to fully support python 3.10 and may even end up getting abandoned, at best it will be much slower and more brittle.
Please, please put pragmatism over principle and accept PEP 649. As discussed in
this issue, using `typing.get_type_hints()` is not a good replacement for type annotations that are accessible as python objects.
I know this is not a popularity contest, but I think it's worth explaining how widely used pydantic is for those who don't use it or haven't heard of it:
- it's downloaded ~7m times a month and is the most popular standalone python data validation library by stars
- it's used (in production and open source projects) by most of the big tech companies you've heard of - it's widely used both in web development and data science
- it is one of the foundations of FastAPI which is by far the fastest growing python web framework and recently came third (behind django and flask) in web frameworks by usage in the python developer survey
Pydantic is not the only one, there are numerous other libraries that use type annotations at runtime.
In short, you may not like it, but runtime inspection of type annotations makes python better, and a massive and growing number of people rely on that.
Rejecting PEP 649 would put that in peril, please accept it.
Samuel