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 nodakai
Recipients nodakai
Date 2019-06-27.09:51:45
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1561629105.71.0.460566565999.issue37427@roundup.psfhosted.org>
In-reply-to
Content
class X:
    def __bool__(self):
        return True

x = [1, 2, 3]
x.sort(reverse=X())
print(x)
print(sorted([1, 2, 3], reverse=X()))

TypeError: an integer is required (got type X)

We can always still do

x.sort(reverse=bool(X()))
print(sorted([1, 2, 3], reverse=bool(X())))

but that isn't cool
History
Date User Action Args
2019-06-27 09:51:45nodakaisetrecipients: + nodakai
2019-06-27 09:51:45nodakaisetmessageid: <1561629105.71.0.460566565999.issue37427@roundup.psfhosted.org>
2019-06-27 09:51:45nodakailinkissue37427 messages
2019-06-27 09:51:45nodakaicreate