What are built-in class attributes in Python?

PythonServer Side ProgrammingProgramming

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.

raja
Published on 12-Jan-2018 14:08:43
Advertisements