Runtime Data Attributes
type.__dict__
Read-only live view of a class namespace, not a dictionary of inherited attributes. Use setattr to update ordinary mutable classes.
Formal Syntax & Structure
python syntaxpython
Cls.__dict__Return Value
types.MappingProxyType
Value exposed by this attribute; availability and mutability depend on the owner as described.
Working Example
Example Snippetpython
class Base: x = 1class C(Base): y = 2print((C.__dict__['y'], 'x' in C.__dict__))