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 Dennis Sweeney
Recipients Dennis Sweeney, akuvfx
Date 2021-10-20.23:02:09
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1634770929.38.0.975224660926.issue45542@roundup.psfhosted.org>
In-reply-to
Content
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.
History
Date User Action Args
2021-10-20 23:02:09Dennis Sweeneysetrecipients: + Dennis Sweeney, akuvfx
2021-10-20 23:02:09Dennis Sweeneysetmessageid: <1634770929.38.0.975224660926.issue45542@roundup.psfhosted.org>
2021-10-20 23:02:09Dennis Sweeneylinkissue45542 messages
2021-10-20 23:02:09Dennis Sweeneycreate