Creating a shared object in python

Fabio Z Tessitore fabioztessitore at libero.it
Tue Jul 31 16:16:31 EDT 2007


Il Tue, 31 Jul 2007 15:37:26 -0400, Delgado, Edgardo  CIV NAVAIR 4.1.4.3
ha scritto:

> Is there a way to create a shared object in python?
> 
> Thx,
> 
> Edgar

Usually object are shared in Python. i.e.

# a list
l = [ 1 , 2 , 3 ]

# a list containing l
m = [ l, 4, 5 ]		# now m is [ [1,2,3] , 4 , 5 ]

# ok, let's change l
l[0] = 10

# now m is changed
# NOW m is [ [10,2,3] , 4 , 5 ]



More information about the Python-list mailing list