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 levkivskyi
Recipients gvanrossum, josh.r, levkivskyi, ned.deily, python-dev, serhiy.storchaka, yselivanov
Date 2016-11-10.08:13:42
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1478765622.83.0.737684232682.issue28649@psf.upfronthosting.co.za>
In-reply-to
Content
Guido, Yury, it looks like I solved the puzzle. All the remaining problems are because of forward references. In particular, _ForwardRef keeps a reference to the frame where it was defined:

        typing_globals = globals()
        frame = sys._getframe(1)
        while frame is not None and frame.f_globals is typing_globals:
            frame = frame.f_back
        assert frame is not None
        self.__forward_frame__ = frame

This is old code from 2015 introduced to support __isinstance__ for forward refs. The latter is no more supported anyway, so that I believe this code should be removed.

I will make a PR upstream soon.
History
Date User Action Args
2016-11-10 08:13:42levkivskyisetrecipients: + levkivskyi, gvanrossum, ned.deily, python-dev, serhiy.storchaka, yselivanov, josh.r
2016-11-10 08:13:42levkivskyisetmessageid: <1478765622.83.0.737684232682.issue28649@psf.upfronthosting.co.za>
2016-11-10 08:13:42levkivskyilinkissue28649 messages
2016-11-10 08:13:42levkivskyicreate