
- Python Basic Tutorial
- Python - Home
- Python - Overview
- Python - Environment Setup
- Python - Basic Syntax
- Python - Comments
- Python - Variables
- Python - Data Types
- Python - Operators
- Python - Decision Making
- Python - Loops
- Python - Numbers
- Python - Strings
- Python - Lists
- Python - Tuples
- Python - Dictionary
- Python - Date & Time
- Python - Functions
- Python - Modules
- Python - Files I/O
- Python - Exceptions
What are built-in class attributes in Python?
According to Python docs, the following are the built-In Class Attributes
Every Python class keeps following built-in attributes and they can be accessed using dot (.) operator like any other attribute:
classname• __dict__ : Dictionary containing the class's namespace.
classname• __doc__ : Class documentation string or None if undefined.
classname• __name__: Class name.
classname• __module__: Module name in which the class is defined.
– This attribute is "__main__" in interactive mode.
classname• __bases__ : A possibly empty tuple containing the base classes, in the order of their occurrence in the base class list.
- Related Articles
- Built-In Class Attributes in Python
- Class & Instance Attributes in Python
- What does built-in class attribute __dict__ do in Python?
- What does built-in class attribute __doc__ do in Python?
- What does built-in class attribute __module__ do in Python?
- What does built-in class attribute __bases__ do in Python?
- What does built-in class attribute __name__ do in Python?\n\n
- When are python classes and class attributes garbage collected?
- What are the common built-in data types in Python?
- How to define attributes of a class in Python?
- How do we reference Python class attributes?
- What are the attributes of a file object in Python?
- What are some amazing projects built using Python?
- What are event attributes in jQuery?
- What are the attributes in C#?

Advertisements