[Python-ideas] Delay evaluation of annotations

אלעזר elazarg at gmail.com
Thu Sep 22 16:29:21 EDT 2016


On Thu, Sep 22, 2016 at 11:02 PM David Mertz <mertz at gnosis.cx> wrote:

> On Thu, Sep 22, 2016 at 12:59 PM, אלעזר <elazarg at gmail.com> wrote:
>
>> I don't If this feature is "nice, but does not worth the complication",
>>> then so be it; I can't claim I know better. I only speculate that it does
>>> not necessarily requires a new custom type.
>>>
>>
> I don't mean a runtime type here (necessarily), but rather a new type for
> the parser.  I.e. transform this actual expression into some sort of
> delayed expression when parsing.
>

Just as a demonstration, the parser can transform `EXP` into `lambda: EXP`
- and that's it. It will not solve everything (e.g. error messages and
.__annotation__ access as Alexander says), but it demonstrates the fact
that the change need not be so deep at all.

Elazar
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20160922/4c240df6/attachment-0001.html>


More information about the Python-ideas mailing list