21.12.20 10:11, Paul Bryan пише: > Wouldn't that still work if bool's __int__ returns 1?
Implementing `__index__` would solve 90% of all problems with non-int booleans. But not the example provided by David (it requires `__add__`). And there may be more specific cases when you need to make arithmetic or bit operations with booleans or sort them. In result you would need to implement all method inherited from int in new bool. And what is the difference? _______________________________________________ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/python-ideas@python.org/message/GITIXGDTGHUZ4SI56GEKT2ZWOINS3KVJ/ Code of Conduct: http://python.org/psf/codeofconduct/