Re: [Rpy] [patch] expose Rf_duplicate

2009-02-08 Thread Nathaniel Smith
On Sun, Feb 8, 2009 at 6:13 AM, Laurent Gautier wrote: > Nice. > > What about calling the method __copy__ instead (so it fits other Python > objects) ? I don't really care either way. I guess calling it "duplicate" avoids any question of whether it should be __copy__ or __deepcopy__, but since it

Re: [Rpy] [patch] expose Rf_duplicate

2009-02-08 Thread Laurent Gautier
Nice. What about calling the method __copy__ instead (so it fits other Python objects) ? L. Nathaniel Smith wrote: > The attached patch adds a method ".duplicate" to rinterface.Sexp > objects. When called, it returns a new Sexp that is identical to the > first, but shares no memory with the fi

[Rpy] [patch] expose Rf_duplicate

2009-02-08 Thread Nathaniel Smith
The attached patch adds a method ".duplicate" to rinterface.Sexp objects. When called, it returns a new Sexp that is identical to the first, but shares no memory with the first. (Underlyingly, it just calls Rf_duplicate.) This is useful when you have an Sexp that you want to mutate, but you also w