[Python-ideas] Optional static typing -- the crossroads

Guido van Rossum guido at python.org
Sun Aug 17 17:03:29 CEST 2014


On Sun, Aug 17, 2014 at 2:22 AM, Greg Ewing <greg.ewing at canterbury.ac.nz>
wrote:

> 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?


Nah, you just have to type-check the decorators. :-)

-- 
--Guido van Rossum (python.org/~guido)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20140817/e813718e/attachment.html>


More information about the Python-ideas mailing list