Test an object is a subclass of the type of another instance
You’d need to extract the type of obj with the type() function: isinstance(obj2, type(obj1)) Note that the second argument is the class, the first is the instance to test. type() is returning the actual class object here, not any separate object. issubclass() works just fine for your usecase: issubclass(type(obj2), Item) Demo: >>> class Item: … … Read more