In python 3.9, I get the following error: In python 3.10, I get no runtime errors: However, Pylance (I am not sure about mypy) didn’t recognize Any. Instead it made it “Unknown”. In fact, I can put anything in 3.10 annotation and it runs just fine. I am not sure if this is the intention of Python3.10
On Nov 30, 2020, at 11:46 AM, Inada Naoki
wrote: I don't say it works 100% use cases. But when you want to use type checker (mypy, pyre), or code completions (e.g. pylance), it "works". When you need to support typing.get_type_hints, you can still `from typing import Any`.
And we can consider resolving typing.Any (and any other globals) in typing.get_type_hints(), instead of adding Any to builtins.
As Abdulla said, having both `any` and `Any` in builtins makes Python more confusing. If typing.get_type_hints() is the problem, why don't we changing typing.get_type_hints() behavior?