Dutcho <dut...@ziggo.nl> added the comment: 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`.
---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue33217> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com