QuestionQ76Verified/Advanced Object-Oriented ProgrammingCopy linkReport a problemAsk AstroTutorSave questionSelect the correct statement concerning the __dict__ attribute.Adict is a special attribute, which is inherent for both classes and instances - it contains a dictionary of object attributes.Bdict is a special attribute, which is inherent for classes - it is a tuple that contains information about base classes of a class.Cdict is a special attribute, which is inherent for classes - it contains information about the class to which a class instance belongs.Ddict is a special attribute, which is inherent for classes - it contains the name of a class.Show AnswerAnswerExplanationThe __dict__ attribute is the mapping used to store an object's writable attributes; this applies to classes and to ordinary instances. By contrast, base classes are represented by __bases__, an instance’s class by __class__, and a class’s name by __name__. Instances that use __slots__ may be an exception and not have a __dict__.Learn morePython Data Model — Special attributesPython Built-in Functions — vars()Show comments0Show commentsCommunity DiscussionNo comments yet. Be the first to start the discussion!
Community Discussion