On Apr 17, 7:25 am, andrew cooke <[EMAIL PROTECTED]> wrote: > On Apr 17, 7:12 am, "[EMAIL PROTECTED]"<[EMAIL PROTECTED]> wrote: > > One other question. I had "foo is False" and you said I need > equality, which is a good point. However, in any other language "not > foo" would be preferable. I was surprised you didn't suggest that > (and I'm unsure now why I didn't write it that way myself). Is there > some common Python standard that prefers "foo == False" to "not foo"? > In addition to the problematic "foo is False" test, Bruno was also saying that assertions of True tend to be more readable than negated assertions of False.
In your original, you were testing for not P or not Q, Bruno recoded this to the equivalent not(P and Q). That is, the direct way to change the 'is' identity testing to equality testing would have been: if (not self.ignore_identical or new_value != obj._auto_write_dict[self.name]): But Bruno further changed this to: if not (self.ignore_identical and new_value == obj._auto_write_dict[self.name]): -- Paul -- http://mail.python.org/mailman/listinfo/python-list