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

Yann Kaiser kaiser.yann at gmail.com
Mon Jan 19 23:16:38 CET 2015


On Mon Jan 19 2015 at 10:53:52 PM Cem Karan <cfkaran2 at gmail.com> wrote:

>
> On Jan 19, 2015, at 3:30 PM, Devin Jeanpierre <jeanpierreda at gmail.com>
> wrote:
>
> > On Sun, Jan 18, 2015 at 4:01 PM, Greg <greg.ewing at canterbury.ac.nz>
> wrote:
> >> On 19/01/2015 8:34 a.m., Guido van Rossum wrote:
> >>>
> >>> I'm putting a line in the sand: annotations are
> >>> for types
> >>
> >>
> >> Do you mean *static* types, or types in general?
> >>
> >> If they're only for static type checking, this seems a waste of a
> >> facility that evaluates things at run time. Moreover, evaluating
> >> them at run time is actually counterproductive, since it makes
> >> dealing with things like forward references unnecessarily awkward.
> >> It also introduces useless runtime overhead. And they only address
> >> part of the problem, since they only apply to functions and not
> >> other things we might want to specify the type of.
> >
> > Strong +1. The current proposal is a historical accident, it would not
> > be designed this way if it was designed from scratch. That's not a
> > nice thing to include in the core language. (Although it does happen
> > often, since "practicality beats purity").
> >
> > I like the :: idea.
>
> +1 on the :: idea.
>
> As for the typing system, I think the proposal is pretty much spot on.  I
> know I've been harping on annotations being forcefully restricted to types
> only, but the proposal itself (the typing library, etc.) is a really good
> proposal.  Unless Python suddenly stops being Python, it's not too likely
> that any typing system can handle all possible cases of what we can do in
> the language (at least, not without becoming insanely unwieldy).
>

The :: idea creates unambiguous space for static/type annotations which
wouldn't even have to compile and execute and thus escape less-than-optimal
solutions to the forward reference problems, all this without needlessly
interfering with existing or potential uses of annotations for run-time
purposes, a feature unique(?) to python.

+1 on the :: idea.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20150119/47020448/attachment.html>


More information about the Python-ideas mailing list