Message314900
Fully agree that Flag.__contains__ must RETURN False or True; that's why I suggested it RAISES TypeError
The exception was to be consistent with e.g. Flag.__and__, which by returning NotImplemented transfers to type(other).__rand__, and assuming __rand__ cannot handle Flag and also returns NotImplemented, falls back to the interpreter raising TypeError. Also e.g. 1 in 'hello' raises TypeError.
For Flag, I wouldn't strongly oppose to False for other being a different type. However, classes derived from Flag could face issues, e.g. `class MyIntFlag (Flag, int): pass`. |
|
Date |
User |
Action |
Args |
2018-04-03 21:36:22 | Dutcho | set | recipients:
+ Dutcho, barry, eli.bendersky, ethan.furman |
2018-04-03 21:36:22 | Dutcho | set | messageid: <1522791382.36.0.467229070634.issue33217@psf.upfronthosting.co.za> |
2018-04-03 21:36:22 | Dutcho | link | issue33217 messages |
2018-04-03 21:36:22 | Dutcho | create | |
|