How to create an array which can be used also as a dictionary

Chris Rebert clp2 at rebertia.com
Thu Sep 10 15:59:27 EDT 2009


On Thu, Sep 10, 2009 at 12:51 PM, Hans Müller <heintest at web.de> wrote:
> Diez B. Roggisch wrote:
>> Hans Müller wrote:
<snip>
>>> But what happens if i modify
>>> a[1].value1 = 1000
>>> is
>>> d["aax"].value1 now 1000 or still "hello" as in this example ?
>>
>> It's changed. Didn't you try that?
>>
> to be true, no - not in this direct context.
>
> btw. how can I get a copy when I need it ?

The `copy` module:
http://docs.python.org/library/copy.html

Cheers,
Chris
--
http://blog.rebertia.com



More information about the Python-list mailing list