Open atollk opened 4 years ago
Hi,
am I incorrect in thinking that for Python 3 inline type hints are preferred, and PEP 561 is more about Python 2?
@ericvergnaud PEP 561 was defined for Python 3.7. For a package to have proper type checking support nowadays, both inline typing (or typed stubs) and the py.typed
file described in the PEP have to be present.
In other words, mypy will report an error on imports of Antlr, even though it offers inline type hints, because it does not follow PEP 561.
PEP 561 for Python 3 recommends adding an empty "py.typed" file to a package for type hints to be found. This is required for tools such as mypy.