Message274343
Ok, I believe you that you have the interface for IntFlags right (I always did, and I apologize if I didn't make it clear from the start). All my questions pertain to Flags.
You said what to me seem like two contradictory things:
> Not having 2 named has different consequences for Flag vs IntFlag (although *neither is an error*): Flag: no combination of flags will ever have the 2 bit set
> if MyFlags is a Flag then MyFlags(impossible_combination) *will raise an exception.*
Are you saying that after I write
class MyFlags(Flags):
b001 = 1
b011 = 3
b100 = 4
b110 = 6
this is _not_ an error, but if after that I call
print(MyFlags(7))
it _is_ an error? It doesn't seem so bad now I think about it, but I'd like the error to be reported before ("3 has bit of value 2 set, but that bit is not a member" or something like that). |
|
Date |
User |
Action |
Args |
2016-09-04 06:19:10 | veky | set | recipients:
+ veky, barry, rhettinger, vstinner, ezio.melotti, r.david.murray, eli.bendersky, ethan.furman, python-dev, martin.panter, serhiy.storchaka |
2016-09-04 06:19:09 | veky | set | messageid: <1472969949.96.0.857062984322.issue23591@psf.upfronthosting.co.za> |
2016-09-04 06:19:09 | veky | link | issue23591 messages |
2016-09-04 06:19:09 | veky | create | |
|