Re: [Python-Dev] Enum, Flag, __contains__, and False vs TypeError

2018年4月04日 13:14:48 -0700

I expect that for IntFlag `x in flags` is equivalent either to
 bool(x | flags.value)
or to
 (x | flags.value) == x
It should return some result only if x is an integer (or compatible with integers) and raise a TypeError otherwise. Don't add any special checks unless there are good reasons for this. Keep the code as simple as possible.
_______________________________________________
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to