A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2011-May/111517.html below:

[Python-Dev] Python 3.x and bytes

[Python-Dev] Python 3.x and bytes [Python-Dev] Python 3.x and bytesGuido van Rossum guido at python.org
Thu May 19 19:46:14 CEST 2011
On Thu, May 19, 2011 at 10:50 AM, Ethan Furman <ethan at 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)
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4