Author Dutcho
Recipients Dutcho, barry, eli.bendersky, ethan.furman
Date 2018-04-03.21:36:22
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1522791382.36.0.467229070634.issue33217@psf.upfronthosting.co.za>
In-reply-to
Content
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`.
History
Date User Action Args
2018-04-03 21:36:22Dutchosetrecipients: + Dutcho, barry, eli.bendersky, ethan.furman
2018-04-03 21:36:22Dutchosetmessageid: <1522791382.36.0.467229070634.issue33217@psf.upfronthosting.co.za>
2018-04-03 21:36:22Dutcholinkissue33217 messages
2018-04-03 21:36:22Dutchocreate