__bases__
Dunder AttributePython 2.0+Advanced
Tuple of base classes of a class
Quick Info
- Documentation
- Official Docs
- Python Version
- 2.0+
Learn by Difficulty
Quick Example
python
# __bases__ holds direct parent classes class Animal: pass class Dog(Animal): pass print(Dog.__bases__) print(int.__bases__) print(bool.__bases__)
__bases__ is a special attribute that tuple of base classes of a class.
Try in PlaygroundTags
oopintrospectioncore