[pypy-svn] r9023 - pypy/dist/pypy/objspace/std

ac at codespeak.net ac at codespeak.net
Wed Feb 9 11:29:19 CET 2005


Author: ac
Date: Wed Feb  9 11:29:19 2005
New Revision: 9023

Modified:
   pypy/dist/pypy/objspace/std/tupletype.py
Log:
Optimize creation of a tuple from annother tuple.

Modified: pypy/dist/pypy/objspace/std/tupletype.py
==============================================================================
--- pypy/dist/pypy/objspace/std/tupletype.py	(original)
+++ pypy/dist/pypy/objspace/std/tupletype.py	Wed Feb  9 11:29:19 2005
@@ -5,6 +5,9 @@
     from pypy.objspace.std.tupleobject import W_TupleObject
     if w_items is None:
         tuple_w = []
+    elif (space.is_w(w_tupletype, space.w_tuple) and
+          space.is_w(space.type(w_items), space.w_tuple)):
+        return w_items
     else:
         tuple_w = space.unpackiterable(w_items)
     w_obj = space.allocate_instance(W_TupleObject, w_tupletype)



More information about the Pypy-commit mailing list