Miles a écrit : > On Jul 12, 8:37 pm, Alan Isaac <[EMAIL PROTECTED]> wrote: >> I do not like that bool(False-True) is True. > > I've never seen the "A-B" used to represent "A and not B", nor have I > seen any other operator used for that purpose in boolean algebra, > though my experience is limited. Where have you seen it used?
I've personnaly seen the usual arithmatic operators used for boolean algebra in quite a lot of papers covering the topic - but I've always had to translate them to more common boolean ops to understand these papers. > What's wrong with 'and', 'or', and 'not'? I think that redefining *, > +, and - to return booleans would only encourage programmers to use > them as shortcuts for standard boolean operations--I'd hate to see > code like this: >>>> if user.registered * (user.age > 13) - user.banned: ... > OMG ! Lord have mercy ! St Guido, save us ! > I don't mind that arithmatic operations are _possible_ with bools, but > I would strongly prefer to see the boolean keywords used for > operations on booleans. +10 -- http://mail.python.org/mailman/listinfo/python-list