Explanation of list reference

Gregory Ewing greg.ewing at canterbury.ac.nz
Sun Feb 16 23:40:57 CET 2014


Steven D'Aprano wrote:
> And indeed numpy arrays do share state. Why? No idea. Somebody thought 
> that it was a good idea. (Not me though...)

Probably because they're often large and people don't
want to incur the overhead of copying them any more
than necessary. So slices are defined to return views
rather than independent objects.

-- 
Greg



More information about the Python-list mailing list