Check if the class myObj
is a subclass of myAge
:
class myAge:
age = 36
class myObj(myAge):
name = "John"
age = myAge
x = issubclass(myObj, myAge)
Try it Yourself » Definition and UsageThe issubclass()
function returns True
if the specified object is a subclass of the specified object, otherwise False
.
issubclass(object, subclass)
Parameter Values Parameter Description object Required. An object. subclass A class object, or a tuple of class objects Related PagesThe isinstance() function, to check if an object is of a certain type.
Track your progress - it's free!
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4