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

php - Permission denied. Laravel linux server -

google bigquery - Delta between query execution time and Java query call to finish -

python - Pandas two dataframes multiplication? -