Re: [pypy-dev] Adding init/variables to W_Root

2016-12-19 Thread Frank Wang
Hi Armin, If I modify the line to __slots__ = ('__weakref__', 'rb_flags',), I get the following error: [translation:ERROR] AssertionError: : to run register_finalizer() untranslated, the object must not have __slots__ If I remove that line completely, I get the following error, [translation:ERR

Re: [pypy-dev] Adding init/variables to W_Root

2016-12-19 Thread Armin Rigo
Hi Frank, On 19 December 2016 at 05:29, Frank Wang wrote: > Attribute 'rb_flags' on > should be read-only. Ah, did you adapt or remove this line in class W_Root? __slots__ = ('__weakref__',) The annotator complains, I think, because 'rb_flags' is forbidden by this line (which is useful to

Re: [pypy-dev] Adding init/variables to W_Root

2016-12-18 Thread Frank Wang
Hi Armin, Thanks for the help! I tried your suggestion, and I get the following error when I try to call that function on a wrapped object (instead of _my_extra_dict, I named the attribute "rbflags" and called the function get_rbflags) : Attribute 'rb_flags' on should be read-only. This error ca

Re: [pypy-dev] Adding init/variables to W_Root

2016-12-16 Thread Carl Friedrich Bolz
Hi Frank, Yes, you'll get an instance variable that way. Cheers, Carl Friedrich On December 16, 2016 6:05:56 PM GMT+01:00, Frank Wang wrote: >Hi Armin, > >Thanks for the suggestion! I'll see if that works. Just to make sure. >This >will give me an instance variable? I need values of the extr

Re: [pypy-dev] Adding init/variables to W_Root

2016-12-16 Thread Frank Wang
Hi Armin, Thanks for the suggestion! I'll see if that works. Just to make sure. This will give me an instance variable? I need values of the extra dict to be different for different instantiations of W_Root. Frank On Fri, Dec 16, 2016 at 11:19 AM, Armin Rigo wrote: > Hi Frank, > > On 15 Decemb

Re: [pypy-dev] Adding init/variables to W_Root

2016-12-16 Thread Armin Rigo
Hi Frank, On 15 December 2016 at 21:06, Frank Wang wrote: > Right now, I know W_Root has no __init__ function, and when I try to add > one. I run into all sorts of problems because TypeDef calls W_Root.__new__ > with some parameters, but "new" function seems to be called nowhere else. I suspect

[pypy-dev] Adding init/variables to W_Root

2016-12-15 Thread Frank Wang
Hi, I don't know if this is the proper list to ask this question. I am trying to add a dictionary to W_Root. The reason for this is that I want all interpreter objects to contain this dictionary. This is for a research project to implement some form of information flow control in PyPy. Right now