Message206245
Indeed, the definition and use of __index__ has derived since PEP 357. Nowadays, __index__ means "can be converted to an int without loss".
In any case, I find the behaviour of your "logical type" a bit dubious. If it's like bool but ternary, it *should* convert to int (or perhaps be an int subclass like bool). |
|
Date |
User |
Action |
Args |
2013-12-15 17:28:32 | pitrou | set | recipients:
+ pitrou, mark.dickinson, ethan.furman, serhiy.storchaka |
2013-12-15 17:28:32 | pitrou | set | messageid: <1387128512.63.0.72990947945.issue19988@psf.upfronthosting.co.za> |
2013-12-15 17:28:32 | pitrou | link | issue19988 messages |
2013-12-15 17:28:32 | pitrou | create | |
|