]> granicus.if.org Git - python/commit
Transform "x in (1,2,3)" to "x in frozenset([1,2,3])".
authorRaymond Hettinger <python@rcn.com>
Sun, 6 Feb 2005 22:05:42 +0000 (22:05 +0000)
committerRaymond Hettinger <python@rcn.com>
Sun, 6 Feb 2005 22:05:42 +0000 (22:05 +0000)
commita164574937d6ed32060ad34ea04913ca10741394
treed9afe6c3cad9bd6b961435d6ea1e1572f8001b8c
parentdbecd93b7203cd187c1978de1207c29d3a9a686c
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.
Lib/test/test_peepholer.py
Python/compile.c