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 <armin.r...@gmail.com> wrote: > Hi Frank, > > On 15 December 2016 at 21:06, Frank Wang <fra...@mit.edu> 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 there is no clean way to add a __init__() method to W_Root. > You could use default attributes instead: > > class W_Root: > _my_extra_dict = None > > def get_extra_dict(self): > if self._my_extra_dict is None: > self._my_extra_dict = {} > return self._my_extra_dict > > > > A bientôt, > > Armin. >
_______________________________________________ pypy-dev mailing list pypy-dev@python.org https://mail.python.org/mailman/listinfo/pypy-dev