Python issubclass() Function
Description
issubclass() The method determines whether the parameter class is a subclass of the type parameter classinfo.
Syntax
The following is the syntax of the issubclass() method:
issubclass(class, classinfo)
Parameters
- class -- the class.
- classinfo -- the class.
Return Value
Returns True if class is a subclass of classinfo, otherwise returns False.
Example
The following examples demonstrate the use of the issubclass function:
#!/usr/bin/python
-- coding: UTF-8 --
class
A
:
pass
class
B
(
A
)
:
pass
(
issubclass
(
B
,
A
)
)
Python built-in function