[pypy-commit] pypy default: write a test and slightly modify conditions. I think I understand typeorder
fijal
noreply at buildbot.pypy.org
Thu Sep 29 14:15:11 CEST 2011
Author: Maciej Fijalkowski <fijall at gmail.com>
Branch:
Changeset: r47673:a39254f1e82a
Date: 2011-09-29 09:14 -0300
http://bitbucket.org/pypy/pypy/changeset/a39254f1e82a/
Log: write a test and slightly modify conditions. I think I understand
typeorder slightly better now
diff --git a/pypy/objspace/std/objspace.py b/pypy/objspace/std/objspace.py
--- a/pypy/objspace/std/objspace.py
+++ b/pypy/objspace/std/objspace.py
@@ -84,7 +84,7 @@
transparent.setup(self)
for type, classes in self.model.typeorder.iteritems():
- if len(classes) == 3:
+ if len(classes) >= 3:
# W_Root, AnyXxx and actual object
self.gettypefor(type).interplevel_cls = classes[0][0]
diff --git a/pypy/objspace/std/test/test_stdobjspace.py b/pypy/objspace/std/test/test_stdobjspace.py
--- a/pypy/objspace/std/test/test_stdobjspace.py
+++ b/pypy/objspace/std/test/test_stdobjspace.py
@@ -46,3 +46,17 @@
assert space.sliceindices(w_slice, w(3)) == (1,2,1)
assert space.sliceindices(w_obj, w(3)) == (1,2,3)
+ def test_fastpath_isinstance(self):
+ from pypy.objspace.std.stringobject import W_StringObject
+ from pypy.objspace.std.intobject import W_IntObject
+
+ space = self.space
+ assert space.w_str.interplevel_cls is W_StringObject
+ assert space.w_int.interplevel_cls is W_IntObject
+ class X(W_StringObject):
+ def __init__(self):
+ pass
+
+ typedef = None
+
+ assert space.isinstance_w(X(), space.w_str)
More information about the pypy-commit
mailing list