Author veky
Recipients barry, eli.bendersky, ethan.furman, ezio.melotti, martin.panter, python-dev, r.david.murray, rhettinger, serhiy.storchaka, veky, vstinner
Date 2016-09-04.06:19:09
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1472969949.96.0.857062984322.issue23591@psf.upfronthosting.co.za>
In-reply-to
Content
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).
History
Date User Action Args
2016-09-04 06:19:10vekysetrecipients: + veky, barry, rhettinger, vstinner, ezio.melotti, r.david.murray, eli.bendersky, ethan.furman, python-dev, martin.panter, serhiy.storchaka
2016-09-04 06:19:09vekysetmessageid: <1472969949.96.0.857062984322.issue23591@psf.upfronthosting.co.za>
2016-09-04 06:19:09vekylinkissue23591 messages
2016-09-04 06:19:09vekycreate