Jack O'Connor added the comment: Yury, do we need to handle more complicated infinite loops, where "self" doesn't actually show up in the loop? Here's an example:
try: raise Exception except Exception as ex: loop1 = Exception() loop2 = Exception() loop1.__context__ = loop2 loop2.__context__ = loop1 ex.__context__ = loop1 hasattr(1, 'aa') I'm unfamiliar with CPython, so I don't know whether full-blown loop detection belongs here. Maybe we could add a hardcoded limit like "fail if we loop more than X times"? ---------- nosy: +oconnor663 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue25782> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com