[PIPython] copy()  di  dizionari
    Nicola Larosa 
    nico
       
    Gio 28 Apr 2005 19:28:26 CEST
    
    
  
> come mai copy() non funziona con i dizionari interni?
Nella doc c'è scritto *shallow* copy, cioé solo il primo livello è diverso,
i riferimenti sottostanti restano agli stessi oggetti.
Per ottenere questo devi usare il modulo copy:
>>> import copy
>>> b = copy.deepcopy(a)
-- 
Nicola Larosa - nico a tekNico.net
Somebody has to go first, and be willing to accept the consequences.
To dream the impossible dream, because it's only impossible so long
as everybody still thinks they're the only one who has that dream.
 -- Phillip J. Eby, dirtSimple.org, January 2005
    
    
More information about the Python
mailing list