Some problems with classes

Bruno Desthuilliers bdesth.quelquechose at free.quelquepart.fr
Mon Sep 1 12:18:57 EDT 2008


Chris Rebert a écrit :
> On Sun, Aug 31, 2008 at 6:39 PM, ssecorp <circularfunc at gmail.com> wrote:
>> Why/how is it possible to add variables like this? I don't understand
>> this mechanism:
>> http://docs.python.org/tut/node11.html#SECTION0011330000000000000000
> 
> Under the covers, Python objects are implemented using dictionaries,

Not necessarily.

> so adding an attribute just adds a new key-value pair to the object's
> internal dictionary (which, incidentally, you can access as
> someobj.__dict__).

Idem.



More information about the Python-list mailing list