Mark Dickinson <dicki...@gmail.com> added the comment:
> I'm finding it rather hard to guess what the rules are for what works and > what doesn't So now that I've looked at the source: anything with an `__int__` method works, except that `float` instances are explicitly excluded. So this explains for example: >>> sorted([1, 2, 3], reverse=numpy.float64(0.5)) Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: integer argument expected, got float >>> sorted([1, 2, 3], reverse=numpy.float32(0.5)) [1, 2, 3] ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue37427> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com