On 12/6/10 7:17 PM, Moritz Beber wrote:
> Dear list members,
>
> in order to make sure that the return value of an rpy2 function is not
> NULL, I need access to the R NULL singleton to perform the comparison.
> In the new features section
> http://rpy.sourceforge.net/rpy2/doc-2.2/html/changes.html, I find
> exactly what I want: rpy2.rinterface.NULL. However, apparently the
> rpy2.rinterface module does not contain NULL as stated, even though my
> rpy2.__version__ is '2.2.0dev'.

For a forgotten reason, if any, it is called RNULLArg. This most likely 
a mistake.

> I found NULL in rpy2.robjects.constants but its type is<type
> 'rpy2.rinterface.Sexp'>  whereas the returned NULL value has a type of
> <class 'rpy2.robjects.robject.RObject'>. Unfortunately, calling bool on
> the returned RObject evaluates to True and not False.

Oversight (now fixed), but there appear to be a problem with my 
understanding of C-level class definitions and __nonzero__().

 >> import rpy2.rinterface as ri
 >>> ri.initr()
0
 >>> NULL = ri.RNULLType()
 >>> bool(NULL)
True
 >>> NULL.__nonzero__()
False


> Any help is greatly appreciated.
>
> Cheers,
> Moritz
>
> ------------------------------------------------------------------------------
> What happens now with your Lotus Notes apps - do you make another costly
> upgrade, or settle for being marooned without product support? Time to move
> off Lotus Notes and onto the cloud with Force.com, apps are easier to build,
> use, and manage than apps on traditional platforms. Sign up for the Lotus
> Notes Migration Kit to learn more. http://p.sf.net/sfu/salesforce-d2d
> _______________________________________________
> rpy-list mailing list
> rpy-list@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/rpy-list


------------------------------------------------------------------------------
What happens now with your Lotus Notes apps - do you make another costly 
upgrade, or settle for being marooned without product support? Time to move
off Lotus Notes and onto the cloud with Force.com, apps are easier to build,
use, and manage than apps on traditional platforms. Sign up for the Lotus 
Notes Migration Kit to learn more. http://p.sf.net/sfu/salesforce-d2d
_______________________________________________
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list

Reply via email to