osdir.com


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Explanation of list reference


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