References and copying

danmcleran at yahoo.com danmcleran at yahoo.com
Fri Jun 9 14:23:03 EDT 2006


> Please verify before asserting:
>
> >>> a = [[1, 2], [3, 4]]
> >>> b = a[1]
> >>> b is a[1]
> True
> >>> id(b)
> 46912496915448
> >>> id(a[1])
> 46912496915448

Right, I must have had slicing on the brain.




More information about the Python-list mailing list