+1 -----הודעה מקורית----- מאת: [EMAIL PROTECTED] בשם Charles R Harris נשלח: ה 20-מרץ-08 17:12 אל: Discussion of Numerical Python נושא: Re: [Numpy-discussion] Ravel and inplace modification On Thu, Mar 20, 2008 at 9:11 AM, Charles R Harris <[EMAIL PROTECTED]> wrote:
> > > On Thu, Mar 20, 2008 at 6:04 AM, Gael Varoquaux < > [EMAIL PROTECTED]> wrote: > > > At the nipy sprint in Paris, we have been having a discussion about > > methods modifying inplace and returning a view, or returning a copy. > > > > The main issue is with ravel that tries to keep a view, but that > > obviously has to do a copy sometimes. (Is ravel the only place where > > this > > behavior can happen ?). We came up with the following scenario: > > > > Mrs Jane is an experienced Python developper, working with less > > experienced developpers. She has developped a set of functions to > > process > > data that assume they can use the ravel method returning a view. One day > > another programmes feeds it new kind of data. The functions work, but > > return something wrong. > > > > We (Stefan van der Walt, Matthew Brett and I) are suggesting that it > > would be a good idea to add a keyword to the ravel method so that it > > raises an exception if it cannot return a view. Stefan is proposing to > > implement it. > > > > What do people think about this? Should Stefan go ahead? > > > > Ravel is not writeable, so it can't be used on the left side of > assignments where the view/copy semantics could be a problem. > Argghhh, how did that line sneak in there? Ignore it. Chuck
<<winmail.dat>>
_______________________________________________ Numpy-discussion mailing list [email protected] http://projects.scipy.org/mailman/listinfo/numpy-discussion
