Re: PEAK-Rules and PyPy

Marcin Tustin <[email protected]> Tue, 16 Oct 2012 12:26:45 -0400
Newsgroups gmane.comp.python.peak
Message-ID <CAJTzQMAPF8Etr13pVaxHLuf5=C5aM0cMn0jTuKa8AhaDS6gYQg@mail.gmail.com>
--===============0471483967==
Content-Type: multipart/alternative; boundary=e89a8ff250eeb5c88b04cc2f9e49

--e89a8ff250eeb5c88b04cc2f9e49
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: quoted-printable

Please see:
http://docs.python.org/library/__builtin__.html?highlight=3D__builtins__

*CPython implementation detail:* Most modules have the name __builtins__ (n=
ote
> the 's') made available as part of their globals. The value of__builtins_=
_ is
> normally either this module or the value of this modules=92s __dict__ att=
ribute.
> Since this is an implementation detail, it may not be used by alternate
> implementations of Python.


On Tue, Oct 16, 2012 at 12:22 PM, PJ Eby <pje-Wh6+Hckhi6HFNGf7iClzIwC/[email protected]> wrote:

> On Tue, Oct 16, 2012 at 11:18 AM, Alain Poirier
> <alain.poirier-HPmRmcG/[email protected]> wrote:
> >   File
> "/private/tmp/PEAK-Rules-0.5a1.dev-r2707/peak/rules/predicates.py", line
> 595, in _parse_string
> >     b =3D CriteriaBuilder(engine.arguments, ctx.localdict, ctx.globaldi=
ct,
> __builtins__)
> >   File "/private/tmp/PEAK-Rules-0.5a1.dev-r2707/peak/rules/codegen.py",
> line 334, in __init__
> >     dict([(k,self.Const(v)) for k,v in ns.iteritems()]) for ns in
> namespaces
> > AttributeError: 'module' object has no attribute 'iteritems'
> >
> >
> > Do you think it could be possible to have a working PyPy version of Pea=
k
> Rules?
>
> It depends. It looks like the problem above is that __builtins__ in
> PyPy might be a module instead of a dictionary?  If so, that's
> probably a bug in PyPy that needs to be fixed.
>
> There are likely to be other problems besides this one, but let's take
> them one at a time.  ;-)
> _______________________________________________
> PEAK mailing list
> [email protected]
> http://www.eby-sarna.com/mailman/listinfo/peak
>



--=20
Marcin Tustin
Tel: +44 (0) 7773 787 105 (UK)
       +1  917 553 3974 (US)

--e89a8ff250eeb5c88b04cc2f9e49
Content-Type: text/html; charset=windows-1252
Content-Transfer-Encoding: quoted-printable

Please see:=A0<a href=3D"http://docs.python.org/library/__builtin__.html?hi=
ghlight=3D__builtins__">http://docs.python.org/library/__builtin__.html?hig=
hlight=3D__builtins__</a><div><br></div><div><blockquote class=3D"gmail_quo=
te" style=3D"margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-col=
or:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<strong style=3D"font-family:sans-serif;font-size:16px;line-height:20px;tex=
t-align:justify;background-color:rgb(255,255,255)">CPython implementation d=
etail:</strong><span style=3D"font-family:sans-serif;font-size:16px;line-he=
ight:20px;text-align:justify;background-color:rgb(255,255,255)">=A0Most mod=
ules have the name=A0</span><tt class=3D"docutils literal" style=3D"backgro=
und-color:rgb(236,240,243);padding:0px 1px;font-size:0.95em;line-height:20p=
x;text-align:justify"><span class=3D"pre"><span class=3D"highlighted">__bui=
ltins__</span></span></tt><span style=3D"font-family:sans-serif;font-size:1=
6px;line-height:20px;text-align:justify;background-color:rgb(255,255,255)">=
=A0(note the=A0</span><tt class=3D"docutils literal" style=3D"background-co=
lor:rgb(236,240,243);padding:0px 1px;font-size:0.95em;line-height:20px;text=
-align:justify"><span class=3D"pre">&#39;s&#39;</span></tt><span style=3D"f=
ont-family:sans-serif;font-size:16px;line-height:20px;text-align:justify;ba=
ckground-color:rgb(255,255,255)">) made available as part of their globals.=
 The value of</span><tt class=3D"docutils literal" style=3D"background-colo=
r:rgb(236,240,243);padding:0px 1px;font-size:0.95em;line-height:20px;text-a=
lign:justify"><span class=3D"pre"><span class=3D"highlighted">__builtins__<=
/span></span></tt><span style=3D"font-family:sans-serif;font-size:16px;line=
-height:20px;text-align:justify;background-color:rgb(255,255,255)">=A0is no=
rmally either this module or the value of this modules=92s=A0</span><tt cla=
ss=3D"xref py py-attr docutils literal" style=3D"background-color:rgb(255,2=
55,255);padding:0px 1px;font-size:0.95em;font-weight:bold;line-height:20px;=
text-align:justify"><span class=3D"pre">__dict__</span></tt><span style=3D"=
font-family:sans-serif;font-size:16px;line-height:20px;text-align:justify;b=
ackground-color:rgb(255,255,255)">=A0attribute. Since this is an implementa=
tion detail, it may not be used by alternate implementations of Python.</sp=
an></blockquote>
<br><div class=3D"gmail_quote">On Tue, Oct 16, 2012 at 12:22 PM, PJ Eby <sp=
an dir=3D"ltr">&lt;<a href=3D"mailto:pje-Wh6+Hckhi6HFNGf7iClzIwC/[email protected]" target=3D"_blan=
k">pje-Wh6+Hckhi6HFNGf7iClzIwC/[email protected]</a>&gt;</span> wrote:<br><blockquote class=3D"gmai=
l_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left=
:1ex">
<div class=3D"im">On Tue, Oct 16, 2012 at 11:18 AM, Alain Poirier<br>
&lt;<a href=3D"mailto:alain.poirier-HPmRmcG/[email protected]">alain.poirier-HPmRmcG/[email protected]</a=
>&gt; wrote:<br>
&gt; =A0 File &quot;/private/tmp/PEAK-Rules-0.5a1.dev-r2707/peak/rules/pred=
icates.py&quot;, line 595, in _parse_string<br>
&gt; =A0 =A0 b =3D CriteriaBuilder(engine.arguments, ctx.localdict, ctx.glo=
baldict, __builtins__)<br>
&gt; =A0 File &quot;/private/tmp/PEAK-Rules-0.5a1.dev-r2707/peak/rules/code=
gen.py&quot;, line 334, in __init__<br>
&gt; =A0 =A0 dict([(k,self.Const(v)) for k,v in ns.iteritems()]) for ns in =
namespaces<br>
&gt; AttributeError: &#39;module&#39; object has no attribute &#39;iteritem=
s&#39;<br>
&gt;<br>
&gt;<br>
&gt; Do you think it could be possible to have a working PyPy version of Pe=
ak Rules?<br>
<br>
</div>It depends. It looks like the problem above is that __builtins__ in<b=
r>
PyPy might be a module instead of a dictionary? =A0If so, that&#39;s<br>
probably a bug in PyPy that needs to be fixed.<br>
<br>
There are likely to be other problems besides this one, but let&#39;s take<=
br>
them one at a time. =A0;-)<br>
<div class=3D"HOEnZb"><div class=3D"h5">___________________________________=
____________<br>
PEAK mailing list<br>
<a href=3D"mailto:[email protected]">[email protected]</a><br>
<a href=3D"http://www.eby-sarna.com/mailman/listinfo/peak" target=3D"_blank=
">http://www.eby-sarna.com/mailman/listinfo/peak</a><br>
</div></div></blockquote></div><br><br clear=3D"all"><div><br></div>-- <br>=
Marcin Tustin<br>Tel: +44 (0) 7773 787 105 (UK)<br><div>=A0 =A0 =A0 =A0+1 =
=A0917 553 3974 (US)</div><div><br></div><br>
</div>

--e89a8ff250eeb5c88b04cc2f9e49--

--===============0471483967==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
PEAK mailing list
[email protected]
http://www.eby-sarna.com/mailman/listinfo/peak
--===============0471483967==--