Author: Philip Jenvey <[email protected]>
Branch: 
Changeset: r64296:117fde40e6a8
Date: 2013-05-18 16:20 -0700
http://bitbucket.org/pypy/pypy/changeset/117fde40e6a8/

Log:    fix: isinstance fails against mixins

diff --git a/pypy/doc/coding-guide.rst b/pypy/doc/coding-guide.rst
--- a/pypy/doc/coding-guide.rst
+++ b/pypy/doc/coding-guide.rst
@@ -339,8 +339,9 @@
 
 + methods and other class attributes do not change after startup
 + single inheritance is fully supported
-+ simple mixins work too, but the mixed in class needs a ``_mixin_ = True``
-  class attribute
++ simple mixins somewhat work too, but the mixed in class needs a
+  ``_mixin_ = True`` class attribute. isinstance checks against the
+  mixin type will fail when translated.
 
 + classes are first-class objects too
 
diff --git a/pypy/objspace/std/dictmultiobject.py 
b/pypy/objspace/std/dictmultiobject.py
--- a/pypy/objspace/std/dictmultiobject.py
+++ b/pypy/objspace/std/dictmultiobject.py
@@ -1267,7 +1267,8 @@
 def _is_set_like(w_other):
     from pypy.objspace.std.setobject import W_BaseSetObject
     return (isinstance(w_other, W_BaseSetObject) or
-            isinstance(w_other, SetLikeDictView))
+            isinstance(w_other, W_DictViewKeysObject) or
+            isinstance(w_other, W_DictViewItemsObject))
 
 class SetLikeDictView(object):
     _mixin_ = True
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to