Hi William, On Thu, Jun 6, 2013 at 8:14 AM, William ML Leslie <[email protected]> wrote: > On 6 June 2013 16:09, Amaury Forgeot d'Arc <[email protected]> wrote: >> Don't use "is" with immutable objects (except with the singletons: None, >> True, False) > > Never with True or False either. It's required to work by the > language definition, but it's still nonsense.
You can use "x is True" or "x is False", but it means really that x must not be e.g. an integer 0 or 1 but really the boolean you test for. In this sense, it's not most useful but not wrong. But any place where "x is 3" appears is bogus. I vaguely suggested at some point to emit a SyntaxWarning for these cases... A bientôt, Armin. _______________________________________________ pypy-dev mailing list [email protected] http://mail.python.org/mailman/listinfo/pypy-dev
