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 mark.dickinson
Recipients mark.dickinson, nodakai, rhettinger
Date 2019-06-27.12:23:18
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1561638198.89.0.160433760799.issue37427@roundup.psfhosted.org>
In-reply-to
Content
I haven't looked at the source yet, but from experimentation I'm finding it rather hard to guess what the rules are for what works and what doesn't:

Python 3.7.3 (default, Mar 30 2019, 03:37:43) 
[Clang 10.0.0 (clang-1000.11.45.5)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import decimal, fractions, numpy
>>> sorted([1, 2, 3], reverse=0.5)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: integer argument expected, got float
>>> sorted([1, 2, 3], reverse=decimal.Decimal(0.5))
[1, 2, 3]
>>> sorted([1, 2, 3], reverse=fractions.Fraction(0.5))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: an integer is required (got type Fraction)
>>> sorted([1, 2, 3], reverse=numpy.int64(1))
[3, 2, 1]
>>> sorted([1, 2, 3], reverse=numpy.bool_(True))
[3, 2, 1]
History
Date User Action Args
2019-06-27 12:23:18mark.dickinsonsetrecipients: + mark.dickinson, rhettinger, nodakai
2019-06-27 12:23:18mark.dickinsonsetmessageid: <1561638198.89.0.160433760799.issue37427@roundup.psfhosted.org>
2019-06-27 12:23:18mark.dickinsonlinkissue37427 messages
2019-06-27 12:23:18mark.dickinsoncreate