Commit 2d5ea781 authored by Kevin Modzelewski's avatar Kevin Modzelewski

Let isinstance() work with non-type metaclasses

parent c1085d8c
......@@ -1913,9 +1913,9 @@ extern "C" bool isinstance(Box* obj, Box* cls, int64_t flags) {
}
if (!false_on_noncls) {
assert(cls->cls == type_cls);
assert(isSubclass(cls->cls, type_cls));
} else {
if (cls->cls != type_cls)
if (!isSubclass(cls->cls, type_cls))
return false;
}
......
......@@ -26,6 +26,9 @@ class C(object):
__metaclass__ = M
print "Made C", type(C)
print isinstance(C, M)
print isinstance(C, type)
print isinstance(C, int)
def f(*args):
print "f()", args[:2]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment