Was ist das __dict__.__dict__ Attribut einer Python-Klasse?

>>> class A(object): pass
... 
>>> A.__dict__
<dictproxy object at 0x173ef30>
>>> A.__dict__.__dict__
Traceback (most recent call last):
  File "<string>", line 1, in <fragment>
AttributeError: 'dictproxy' object has no attribute '__dict__'
>>> A.__dict__.copy()
{'__dict__': <attribute '__dict__' of 'A' objects> ... }
>>> A.__dict__['__dict__']
<attribute '__dict__' of 'A' objects> # What is this object?

Wenn ich A.something = 10, dieser geht in A.__dict__. Was ist diese <attribute '__dict__' of 'A' objects> gefunden in A.__dict__.__dict__, und Wann wird es etwas beinhalten?

Ein passenderes Beispiel variable gewesen wäre, habe ive. Zumindest wäre es gemacht habe dies eine mehr A.__dict__['ive'] Frage 😉 ich werde sehen, mich aus

InformationsquelleAutor porgarmingduod | 2011-02-02

Schreibe einen Kommentar