This was supposed to go to the list too... ---------- Forwarded message ---------- From: Michael Hudson <[EMAIL PROTECTED]> Date: 10 Mar 2008 13:02 Subject: Re: [pypy-dev] module SomeObject setattr. To: Toon Verwaest <[EMAIL PROTECTED]>
On 10/03/2008, Toon Verwaest <[EMAIL PROTECTED]> wrote: > Hi, > > I'm not yet fully comfortable with the PyPy code so I just lay it out here: > > I have written the following code in the Squeak VM (should change in > the future but its just to show the "problem"): > > <file objtable.py:> > objects = [] > > <file shadow.py:> > objtable.objects += [objofspecifictype] > > This seems not to be translatable since this is translated to: > vX = setattr(objtable-module, 'objects', vY). > > generally setattr are done on SomeInstance which nicely returns None -> > SomeImpossibleValue -> the annotator is happy. > However, modules appear to be instances of SomeObject This is, already, your problem: modules are not supported by RPython (anything that ends up as SomeObject() means translation is not going to work). It's a bit peculiar I guess that the module gets examined here, though I can see why it happens. I think if you write objtable.objects.extend(...) you'll be happier. > on which setattr > returns a SomeObject -> type of vX gets broken. If anything, this should break even more noisily. > (and the bug received is not very obvious since it says that the > original type was (none)...) I can believe this part :/ Cheers, mwh _______________________________________________ [email protected] http://codespeak.net/mailman/listinfo/pypy-dev
