Sorry, I should have looked around a bit more. If I replace pars1 = pars
by pars1 = pars.copy() in the below code, the two dictionaries are
independent.
Stan
Stan Schymanski wrote:
> Dear all,
>
> I tried to store sets of parameter values for plotting in
> dictionaries, but the dictionaries do not seem independent. If I
> delete an entry in one, it disappears in the other one, too. Am I
> doing something wrong or is this a bug? See the example session
> below.
>
> Thanks for your help already!
>
> Stan
>
> ----------------------------------------------------------------------
> | SAGE Version 3.1.4, Release Date: 2008-10-20 |
> | Type notebook() for the GUI, and license() for information. |
> ----------------------------------------------------------------------
>
> sage: var('a b c')
> (a, b, c)
> sage: pars = dict(a=1,b=2,c=3);pars
> {'a': 1, 'b': 2, 'c': 3}
> sage: pars1 = pars; pars1
> {'a': 1, 'b': 2, 'c': 3}
> sage: del pars1['c'];pars1
> {'a': 1, 'b': 2}
> sage: pars
> {'a': 1, 'b': 2}
>
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---