[pypy-commit] pypy default: fix: isinstance fails against mixins
pjenvey
noreply at buildbot.pypy.org
Sun May 19 01:35:01 CEST 2013
Author: Philip Jenvey <pjenvey at underboss.org>
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
More information about the pypy-commit
mailing list