[Python-ideas] Delay evaluation of annotations

Alexander Belopolsky alexander.belopolsky at gmail.com
Thu Sep 22 13:50:30 EDT 2016


On Thu, Sep 22, 2016 at 1:19 PM, אלעזר <elazarg at gmail.com> wrote:

> I propose delaying evaluation of annotation-expressions by either keeping
> the AST of the annotation, or turning it implicitly from EXP into "lambda:
> EXP". Inspection code that is interested in this information can access it
> be calling (or evaluating) it.
>
> It certainly isn't a backward compatible change
>

It can be made almost backward compatible by making __annotations__ a
property that calls your "lambda: EXP"s at the time when it is requested.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20160922/4dc8352e/attachment.html>


More information about the Python-ideas mailing list