Question: ```
def foo(**args):
    for k, v in args.items():
        print type(k), type(v)
    for k, v in args.items():
        k = v
    print k
    print type(k)

foo(a = 10)
foo(**{'a':10})

```

Gives me

```
<type 'str'> <type 'int'>
10
<type 'int'>
<type 'str'> <type 'int'>
10
<type 'int'>

```

So I am confused how am I able to do this as k is a string, so shouldn't I not be able to assign to it?

I obviously can't do

```
In [35]: 'a' = 10
------------------------------------------------------------
   File "<ipython console>", line 1
SyntaxError: can't assign to literal (<ipython console>, line 1)

```

Answer: 
k is not a string, it is just a loop variable. You've just assigned some new value to it and it lost its relation to the dictionary you are iterating over.
Well, when you do `for k, v in args.items()`, in the first (and the only, in your case) iteration the identifier `k` starts pointing to a current key of the dictionary "args", which happens to be a string, right?

When you do `k = v`, `k` starts pointing to whatever `v` points to, which just happens to be an integer. I don't see much of a problem here.

If I understand it correctly, the values of variables in python are *references to objects*.