- Python Home
- About
- News
- Documentation
- Downloads
- Community
- Foundation
- Developer's Guide
- Issue Tracker
- Issues
- Summaries
- User
- Administration
- Help
Message346722
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:45 | nodakai | set | recipients: + nodakai |
| 2019-06-27 09:51:45 | nodakai | set | messageid: <1561629105.71.0.460566565999.issue37427@roundup.psfhosted.org> |
| 2019-06-27 09:51:45 | nodakai | link | issue37427 messages |
| 2019-06-27 09:51:45 | nodakai | create | |

