Currently, the following generates an exception:

>>> s = ri.SexpVector([1, 2, 3, 4], ri.INTSXP)
>>> s.do_slot_assign("dim", ri.SexpVector([2, 2], ri.INTSXP)

The issue is that s has no "dim" attribute to start off with, and
do_slot_assign's implementation checks R_has_slot and errors out if it
returns false.

However, there is no reason to do this; the actual SET_SLOT call that
rpy2 issues does the correct thing whether or not the slot already
exists (it ends up calling exactly the same function as R's own dim<-
operator, in fact).

The attached patch removes the offending check. Built and tested.

-- Nathaniel

Attachment: NEW_allow_new_slot_creation
Description: Binary data

------------------------------------------------------------------------------
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
_______________________________________________
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list

Reply via email to