On Thu, May 19, 2011 at 10:50 AM, Ethan Furman <et...@stoneleaf.us> wrote: > Last thought I have for a possible 'solution' -- when a bytes object is > tested for equality against an int raise TypeError. Precedent being sum() > raising a TypeError when passed a list of strings because performance is so > poor. Reason here being that the intuitive behavior will never work and > will always produce silent bugs.
Not the same thing at all. The == operator is special, and should not raise exceptions; too many things would start randomly failing (e.g. membership tests for a dict that has both ints and bytes as keys, or for a list containing a variety of types). -- --Guido van Rossum (python.org/~guido) _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com