Created
October 11, 2023 00:28
-
-
Save dublado/59c68e49b22900318bec7bda66170ad5 to your computer and use it in GitHub Desktop.
issubclass class heritance
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# You can check for class | |
# inheritance relationships | |
# with the "issubclass()" built-in: | |
>>> class BaseClass: pass | |
>>> class SubClass(BaseClass): pass | |
>>> issubclass(SubClass, BaseClass) | |
True | |
>>> issubclass(SubClass, object) | |
True | |
>>> issubclass(BaseClass, SubClass) | |
False |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment