[Python-ideas] PEP 484 (Type Hints) -- first draft round

Guido van Rossum guido at python.org
Fri Jan 23 17:22:45 CET 2015


Sigh. I guess I'll have to do this.
https://github.com/ambv/typehinting/issues/55

On Fri, Jan 23, 2015 at 5:33 AM, Fetchinson . <fetchinson at googlemail.com>
wrote:

> It looks like type hinting as a feature is applauded by everyone but
> the actual syntax/implementation is polarizing. Could we have a
> section in the PEP listing all alternative sytax/implementations with
> pros and cons? Stuff like:
>
> 1. Stub files
>
>
> 2. property-style type hinting, e.g.:
>
>     @typehints( arg1: int, arg2: str, returns: str )
>     def func( arg1, arg2 )
>         return 'hello'
>
>
> 3. docstrings, e.g.:
>
>     def func( arg1, arg2 ):
>         """type hints: arg1: int, arg2: str, returns: str"""
>         return 'hello'
>
> 4. Cobra-inspired type hints, e.g.:
>
>     def func( arg1, arg2 ):
>         requires:
>             isinstance( arg1, int )
>             isinstance( arg2, str )
>         returns:
>             str
>
>
> Cheers,
> Daniel
>
>
>
> --
> Psss, psss, put it down! - http://www.cafepress.com/putitdown
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> https://mail.python.org/mailman/listinfo/python-ideas
> Code of Conduct: http://python.org/psf/codeofconduct/
>



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


More information about the Python-ideas mailing list