type hinting backward compatibility with python 3.0 to 3.4

Gregory Ewing greg.ewing at canterbury.ac.nz
Sun May 21 19:04:23 EDT 2017


Chris Angelico wrote:
> With mypy, if your classes
> are too dynamic, you might have to create a stub file that's more
> static (but non-functional) just for the type checking. Can you do
> that if your type checker is part of the language?

I think you may have misunderstood. I'm not suggesting that
the runtime interpreter should perform static type checking.
I'm only suggesting that it should treat type annotations
completely passively -- essentially as comments that are
constrained to have the syntax of expressions.

The type checking itself would still be done as a separate
operation that can use stub files, etc. just the same as
mypy does now.

-- 
Greg



More information about the Python-list mailing list