
rhettinger@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