[docs] [issue17546] Document the circumstances where the locals() dict gets updated

bob gailer bgailer at gmail.com
Wed Mar 27 15:08:34 CET 2013


On 3/27/2013 9:48 AM, anatoly techtonik wrote:
> anatoly techtonik added the comment:
>
> Example:
>
>      l = locals()
>      z = dict(a=5, b=3)
>
>      lc = dict(l)
>      zc = dict(z)
>
>      print(lc == l)
>      print(zc == z)
>
> Gives:
>
>      False
>      True
Expected behavior.
lc is not another reference to locals(). It refers to a new object.
zc = ... updates locals() but not lc

-- 
Bob Gailer
919-636-4239
Chapel Hill NC



More information about the docs mailing list