[Python-ideas] Proposal to extend PEP 484 (gradual typing) to support Python 2.7

Guido van Rossum guido at python.org
Mon Jan 11 16:52:28 EST 2016


On Mon, Jan 11, 2016 at 1:48 PM, Pavol Lisy <pavol.lisy at gmail.com> wrote:

> What about this?
>
> def embezzle(self, account: "PEP3107 annotation"):
>     # type: (str) -> Any
>     """Embezzle funds from account using fake receipts."""
>     <code goes here>
>

I don't understand your proposal -- this is not valid Python 2.7 syntax so
we cannot use it.


> ---
>
> And BTW in PEP484 text ->
>
> Functions with the @no_type_check decorator or with a # type: ignore
> comment should be treated as having no annotations.
>
> could be probably? ->
>
> Functions with the @no_type_check decorator or with a # type: ignore
> comment should be treated as having no type hints.
>

In the context of the PEP the latter interpretation is already implied, so
I don't think I need to update the text.

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


More information about the Python-ideas mailing list