Dennis Sweeney <sweeney.dennis...@gmail.com> added the comment:
The PR changes behavior slightly: def f(): class A: def __lt__(self, other): nonlocal x x += 100 return True a = A() x = 1 print(a < x < 10) x = 1 print(a < x and x < 10) ### Before ### >>> f() True False ### After ### >>> f() False False So strictly speaking, this would be backwards-incompatible. But morally, I am not totally sure. ---------- nosy: +Dennis Sweeney _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue45542> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com