2D lists

Carl Banks imbosol at vt.edu
Tue Jan 21 23:53:46 CET 2003


Skip Montanaro wrote:
>    >>> b.append(copy.copy(a))
> 
> or slightly more efficiently:
> 
>    b.append(a[:])
> 
> Copy should only be needed (and then copy.deepcopy) if you are creating
> higher dimensioned arrays/lists.

copy.copy could be useful if you don't know what it is you're shallow
copying.


-- 
CARL BANKS




More information about the Python-list mailing list