python - Where are key/value pairs for an object stored for a Built-in Class? -


where key/value data stored builtin class? not accessible "__dict__" because not considered attributes.

example:

class testnewclass(dict):     def __init__(self, a, b, c):         self.a =         self.b = b         self["item"] = c  x = testnewclass(3, 4, 5)  print(x.a)          # 3 print(x.b)          # 4 print(x["item"])    # 5 print(x.__dict__)   # {"a": 3, "b": 4} c not considered attribute 


Comments

Popular posts from this blog

cookies - Yii2 Advanced - Share session between frontend and mainsite (duplicate of frontend for www) -

angular - password and confirm password field validation angular2 reactive forms -

php - Permission denied. Laravel linux server -