[Python-ideas] Delay evaluation of annotations

Alexander Belopolsky alexander.belopolsky at gmail.com
Thu Sep 22 16:43:05 EDT 2016


On Thu, Sep 22, 2016 at 4:37 PM, Alexander Belopolsky <
alexander.belopolsky at gmail.com> wrote:

> On the second thought, why can't the parser simply replace A with 'A' in
> annotations that appear in the body of class A?  This will only break
> somewhat pathological code that defines A before it is (re)defined by the
> class statement.


Then the default metaclass (type) can go over the annotations and replace
'A' with A that it just computed.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20160922/835223f1/attachment.html>


More information about the Python-ideas mailing list