[pypy-svn] r7521 - pypy/trunk/src/pypy/objspace/flow

hpk at codespeak.net hpk at codespeak.net
Sat Nov 20 17:41:32 CET 2004


Author: hpk
Date: Sat Nov 20 17:41:32 2004
New Revision: 7521

Modified:
   pypy/trunk/src/pypy/objspace/flow/objspace.py
Log:
do the unpackiterable-hack more often: it's reasonably safe to 
assume that if have an expected length for a given w_iterable
that we can perform getitem's on the object 



Modified: pypy/trunk/src/pypy/objspace/flow/objspace.py
==============================================================================
--- pypy/trunk/src/pypy/objspace/flow/objspace.py	(original)
+++ pypy/trunk/src/pypy/objspace/flow/objspace.py	Sat Nov 20 17:41:32 2004
@@ -171,8 +171,7 @@
                 items.append(w_item)
                 i += 1
             return items
-        elif isinstance(w_iterable, Constant) and expected_length is not None: 
-            assert len(w_iterable.value) == expected_length 
+        elif expected_length is not None: 
             return [self.do_operation('getitem', w_iterable, self.wrap(i)) 
                         for i in range(expected_length)]
             # XXX TEMPORARY HACK XXX TEMPORARY HACK XXX TEMPORARY HACK



More information about the Pypy-commit mailing list