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/2005-February/051479.html below:

[Python-checkins] python/dist/src/Python compile.c, 2.340, 2.341

[Python-Dev] Re: [Python-checkins] python/dist/src/Python compile.c, 2.340, 2.341Michael Hudson mwh at python.net
Thu Feb 10 00:22:59 CET 2005
rhettinger at users.sourceforge.net writes:

> Update of /cvsroot/python/python/dist/src/Python
> In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26507/Python
>
> Modified Files:
> 	compile.c 
> Log Message:
> Transform "x in (1,2,3)" to "x in frozenset([1,2,3])".
>
> Inspired by Skip's idea to recognize the throw-away nature of sequences
> in this context and to transform their type to one with better performance.

This breaks code:

>>> [] in (1,)
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
TypeError: list objects are unhashable

(and so breaks test_email -- is noone else running the test suite?).

It's a cute idea, but IMHO violates the principle of least surprise
too much.

Cheers,
mwh

-- 
  ZAPHOD:  Who are you?
  ROOSTA:  A friend.
  ZAPHOD:  Oh yeah? Anyone's friend in particular, or just generally 
           well-disposed to people?               -- HHGttG, Episode 7
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