Tim Hochberg wrote: >-0.5 from me if what we're talking about here is having mutating methods >return self rather than None. Chaining stuff is pretty, but having >methods that mutate self and return self looks like a source of elusive >bugs to me. > >
I'm generally +0 on this idea (it seems like the clarity in writing comes largely for interactive users), and don't see much difficulty in separating the constructs. On the other hand, I don't see much problem in returning a reference to self either. I guess you are worried about the situation where you write b = a.sort() and think you have a new array, but in fact have a new reference to the already-altered 'a'? Hmm.. So, how is this different from the fact that b = a[1:10:3] already returns a reference to 'a' (I suppose in the fact that it actually returns a new object just one that happens to share the same data with a). However, I suppose that other methods don't return a reference to an already-altered object, do they. Tim's argument has moved me from +0 to -0 -Travis ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ Numpy-discussion mailing list Numpy-discussion@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/numpy-discussion