[Python-ideas] Optional static typing -- the crossroads
Greg Ewing
greg.ewing at canterbury.ac.nz
Sun Aug 17 11:22:45 CEST 2014
Guido van Rossum wrote:
> Perhaps a thornier issue is how mypy should handle decorators that
> manipulate the signature or annotations of the function they wrap. But I
> think the only reasonable answer here can be that mypy must understand
> what decorators do if it wants to have any chance at type-checking
> decorated functions.
Seems to me the only way to do that in general is to
execute the decorators. That means importing everything
the decorators depend on and probably running at least
the top-level module code. Is executing arbitrary
code at type-checking time really desirable?
--
Greg
More information about the Python-ideas
mailing list