Author mjpieters
Recipients mjpieters
Date 2016-03-03.18:17:39
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1457029059.35.0.118883999775.issue26477@psf.upfronthosting.co.za>
In-reply-to
Content
A temporary work-around is to use a function to raise a NameError exception when the module attribute doesn't exist yet:

def _forward_A_reference():
    try:
        return a.A
    except AttributeError:
        # not yet..
        raise NameError('A')

class B:
    def spam(self: 'B', eggs: typing.Union['_forward_A_reference()', None]):
        pass
History
Date User Action Args
2016-03-03 18:17:39mjpieterssetrecipients: + mjpieters
2016-03-03 18:17:39mjpieterssetmessageid: <1457029059.35.0.118883999775.issue26477@psf.upfronthosting.co.za>
2016-03-03 18:17:39mjpieterslinkissue26477 messages
2016-03-03 18:17:39mjpieterscreate