On 2011-05-20 15:55, Artur Wroblewski wrote:
> On Fri, May 20, 2011 at 2:16 PM, Laurent Gautier<lgaut...@gmail.com>  wrote:
> [...]
>> This is a problem since rpy2's rinterface is obviously initialized before
>> the embedded R is (rpy2.initr() must be called to initialize R).
> [...]
>> Something is already puzzling: why was this sometimes working ?
> Maybe because, under some conditions, sequence.c is initializing
> NAReal with NAReal_New as new one?

I mean working with some people, not with others, and in my case it 
stops working when I hack in explicitly the numerical value R_NaReal 
takes after initialization.
Otherwise the NA* classes are singletons; PyObject *self is initialized 
only once.

> Just guessing as I still do
> not understand the semantics of NA*_New functions and associated
> RPY_NA_NEW macro - why NAReal_New(1) is called once again
> in sequence.c... shouldn't be there just one NA_Real or do
> I misunderstand the meaing of "new" parameter?

The parameter "new" indicates whether this is a new reference (reference 
count incremented by one) or a borrowed reference.
The macro ensure that the same strategy is applied to all NA* (yet only 
NAReal is causing trouble). Reading the Python source (floatobject.c) 
suggests that there might be dark corner when creating subtypes of float.


Best,

Laurent
> [...]
>
> Best regards,
>
> Artur
>
> ------------------------------------------------------------------------------
> What Every C/C++ and Fortran developer Should Know!
> Read this article and learn how Intel has extended the reach of its
> next-generation tools to help Windows* and Linux* C/C++ and Fortran
> developers boost performance applications - including clusters.
> http://p.sf.net/sfu/intel-dev2devmay
> _______________________________________________
> rpy-list mailing list
> rpy-list@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/rpy-list


------------------------------------------------------------------------------
What Every C/C++ and Fortran developer Should Know!
Read this article and learn how Intel has extended the reach of its 
next-generation tools to help Windows* and Linux* C/C++ and Fortran 
developers boost performance applications - including clusters. 
http://p.sf.net/sfu/intel-dev2devmay
_______________________________________________
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list

Reply via email to