New submission from Svyatoslav <prometheus3...@gmail.com>:
If a class X has nested class Y and class X has annotation Y AFTER the definition of Y, get_type_hints(X) throws NameError if import from future annotations is present. This is because get_type_hints looks only at mro of the class. Its namespace must be included too as locals. ---------- files: annotations.py messages: 384381 nosy: Prometheus3375 priority: normal severity: normal status: open title: get_type_hints throws for nested class with __future__ annotations versions: Python 3.9 Added file: https://bugs.python.org/file49719/annotations.py _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue42829> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com