[Numpy-discussion] copy on demand

Konrad Hinsen hinsen at cnrs-orleans.fr
Mon Jun 17 02:01:05 EDT 2002


> > Then the only solution I see is the current one: default behaviour is
> > view, and when you want a copy yoy copy explicitly. The inverse is not
> > possible, once you made a copy you can't make it behave like a view
> > anymore.
> 
> I don't think it is necessary to create the other object _from_
> the default one.  You could have copy behavior be the default,
> and if you want a view of some array you simply request one
> explicitly with .view, .sub, or whatever.

Let's make this explicit. Given the following four expressions,

1) array
2) array[0]
3) array.view
4) array.view[0]

what would the types of each of these objects be according to your
proposal? What would the indexing behaviour of those types be?
I don't see how you can avoid having either two types or two
different behaviours within one type.

Konrad.
-- 
-------------------------------------------------------------------------------
Konrad Hinsen                            | E-Mail: hinsen at cnrs-orleans.fr
Centre de Biophysique Moleculaire (CNRS) | Tel.: +33-2.38.25.56.24
Rue Charles Sadron                       | Fax:  +33-2.38.63.15.17
45071 Orleans Cedex 2                    | Deutsch/Esperanto/English/
France                                   | Nederlands/Francais
-------------------------------------------------------------------------------




More information about the NumPy-Discussion mailing list