This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author simon.percivall
Recipients simon.percivall
Date 2017-04-03.10:21:14
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1491214874.69.0.0315417893192.issue29966@psf.upfronthosting.co.za>
In-reply-to
Content
For classes with ForwardRef annotations, typing.get_type_hints is unusable.

As example, we have two files:

a.py:
class Base:
    a: 'A'

class A:
    pass

b.py:
from a import Base

class MyClass(Base):
    b: 'B'

class B:
    pass


>>> from typing import get_type_hints
>>> from b import MyClass
>>> get_type_hints(MyClass) #  NameError


What should globals/locals be here?
History
Date User Action Args
2017-04-03 10:21:14simon.percivallsetrecipients: + simon.percivall
2017-04-03 10:21:14simon.percivallsetmessageid: <1491214874.69.0.0315417893192.issue29966@psf.upfronthosting.co.za>
2017-04-03 10:21:14simon.percivalllinkissue29966 messages
2017-04-03 10:21:14simon.percivallcreate