[Python-ideas] Suggestion for standardized annotations

Nick Coghlan ncoghlan at gmail.com
Wed Mar 5 14:45:33 CET 2014


On 5 Mar 2014 22:51, "Paul Moore" <p.f.moore at gmail.com> wrote:
>
> On 5 March 2014 11:53, Cem Karan <cfkaran2 at gmail.com> wrote:
> > Thoughts/suggestions?
>
> I think the core/stdlib position is that agreeing conventions would be
> better done once some real world experience of the practical issues
> and benefits of annotations has been established.

MyPy uses function annotations for optional static typing, which is pretty
much the use case Guido originally had in mind and the main reason that PEP
8 doesn't make combining annotations with an associated decorator
mandatory: http://www.mypy-lang.org/

You do still have to import a particular module to indicate that all
annotations in the importing module are to be interpreted as type
annotations.

Beyond that, the guidance in PEP 8 stands:

"""It is recommended that third party experiments with annotations use an
associated decorator to indicate how the annotation should be
interpreted."""

Cheers,
Nick.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20140305/50045387/attachment.html>


More information about the Python-ideas mailing list