summaryrefslogtreecommitdiffstats
path: root/Misc
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2010-01-16 18:37:38 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2010-01-16 18:37:38 (GMT)
commitb7fbcd396fc4a366433cf6f26cae64fecb056099 (patch)
tree15efa75386a0f8e2d8381267a0c2edd6b551aac3 /Misc
parenta8f480f54597cf20e460b12e17bb0416a8008868 (diff)
downloadcpython-b7fbcd396fc4a366433cf6f26cae64fecb056099.zip
cpython-b7fbcd396fc4a366433cf6f26cae64fecb056099.tar.gz
cpython-b7fbcd396fc4a366433cf6f26cae64fecb056099.tar.bz2
Issue #6690: Optimize the bytecode for expressions such as `x in {1, 2, 3}`,
where the right hand operand is a set of constants, by turning the set into a frozenset and pre-building it as a constant. The comparison operation is made against the constant instead of building a new set each time it is executed (a similar optimization already existed which turned a list of constants into a pre-built tuple). Patch and additional tests by Dave Malcolm.
Diffstat (limited to 'Misc')
-rw-r--r--Misc/NEWS8
1 files changed, 8 insertions, 0 deletions
diff --git a/Misc/NEWS b/Misc/NEWS
index 4c08298..248f1a7 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -12,6 +12,14 @@ What's New in Python 3.2 Alpha 1?
Core and Builtins
-----------------
+- Issue #6690: Optimize the bytecode for expressions such as `x in {1, 2, 3}`,
+ where the right hand operand is a set of constants, by turning the set into
+ a frozenset and pre-building it as a constant. The comparison operation
+ is made against the constant instead of building a new set each time it is
+ executed (a similar optimization already existed which turned a list of
+ constants into a pre-built tuple). Patch and additional tests by Dave
+ Malcolm.
+
- Issue #7622: Improve the split(), rsplit(), splitlines() and replace()
methods of bytes, bytearray and unicode objects by using a common
implementation based on stringlib's fast search. Patch by Florent Xicluna.