Author: Armin Rigo <ar...@tunes.org>
Branch: 
Changeset: r83793:c6fad9d028ef
Date: 2016-04-20 20:49 +0200
http://bitbucket.org/pypy/pypy/changeset/c6fad9d028ef/

Log:    Issue #2277: only special-case two exact lists, not list subclasses,
        because an overridden __iter__() should be called (probably)

diff --git a/pypy/objspace/std/specialisedtupleobject.py 
b/pypy/objspace/std/specialisedtupleobject.py
--- a/pypy/objspace/std/specialisedtupleobject.py
+++ b/pypy/objspace/std/specialisedtupleobject.py
@@ -180,10 +180,9 @@
 
 def specialized_zip_2_lists(space, w_list1, w_list2):
     from pypy.objspace.std.listobject import W_ListObject
-    if (not isinstance(w_list1, W_ListObject) or
-        not isinstance(w_list2, W_ListObject)):
+    if type(w_list1) is not W_ListObject or type(w_list2) is not W_ListObject:
         raise OperationError(space.w_TypeError,
-                             space.wrap("expected two lists"))
+                             space.wrap("expected two exact lists"))
 
     if space.config.objspace.std.withspecialisedtuple:
         intlist1 = w_list1.getitems_int()
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to