Hi,
How can i create a ref to a string ? it doesn't work like lists :S
List : (IDs are the same!)
>>> li=[1, 2, 3, 4, 5]
>>> li_ref=li
>>> id(li)
13545800
>>> id(li_ref)
13545800
>>> li.pop()
5
>>> li
[1, 2, 3, 4]
>>> id(li)
13545800
>>> li_ref
[1, 2, 3, 4]
>>> id(li_ref)
13545800
String : (the ID of each is different!)
>>> s="Hello, "
>>> s_ref=s
>>> id(s)
13553952
>>> id(s_ref)
13553952
>>> s += "World!"
>>> s
'Hello, World!'
>>> s_ref
'Hello, '
>>> id(s)
13560752
>>> id(s_ref)
13553952
So any ideas ?