[Python-ideas] PEP 563: Postponed Evaluation of Annotations, first draft

Guido van Rossum guido at python.org
Mon Sep 11 15:30:54 EDT 2017


On Mon, Sep 11, 2017 at 10:16 AM, Ryan Gonzalez <rymg19 at gmail.com> wrote:

> One thing I want to point out: there are a lot of really useful Python
> libraries that have come to rely on annotations being objects, ranging
> from plac to fbuild to many others. I could understand something that
> delays the evaluation of annotations until they are accessed, but this
> seems really extreme.
>

This is a serious concern and we need to give it some thought. The current
thinking is that those libraries can still get those objects by simply
applying eval() to the annotations (or typing.get_type_hints()). And they
may already have to support that in order to support PEP 484's forward
references. Though perhaps there's a reason why such libraries currently
don't need to handle forward refs?

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


More information about the Python-ideas mailing list