to one with a static metatype raised an obscure error.
verify(L(3)*2 == 6)
verify(L(3)*L(2) == 6)
+ # Test comparison of classes with dynamic metaclasses
+ class dynamicmetaclass(type):
+ __dynamic__ = 1
+ class someclass:
+ __metaclass__ = dynamicmetaclass
+ verify(someclass != object)
+
def errors():
if verbose: print "Testing errors..."
if (!PyArg_ParseTuple(args, "O", &other))
return NULL;
- if (!PyType_IsSubtype(other->ob_type, self->ob_type)) {
+ if (other->ob_type->tp_compare != func &&
+ !PyType_IsSubtype(other->ob_type, self->ob_type)) {
PyErr_Format(
PyExc_TypeError,
"%s.__cmp__(x,y) requires y to be a '%s', not a '%s'",