<div dir="ltr">So from what I&#39;m understanding BytesCodeAssembler is not in a too bad shape atm regarding py3 if i just want to run PEAK-Rules (i still have to look into the problem with `<span style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px">from_function`).</span><div>
<span style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px"><br></span></div><div style><span style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px">The way i run the test is:</span></div>
<div style><font color="#500050" face="arial, sans-serif">nosetests --with-doctest --doctest-extension=txt --doctest-options=&#39;+ELLIPSIS,+NORMALIZE_WHITESPACE&#39;</font><br></div><div style><font color="#500050" face="arial, sans-serif"><br>
</font></div><div style><font color="#500050" face="arial, sans-serif">so whitespaces differences should be ignored properly</font></div><div style><font color="#500050" face="arial, sans-serif"><br></font></div><div style>
<span style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px">&gt;     &gt;&gt;&gt; from peak.util.assembler import TryExcept</span><br style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px">
<span style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px">&gt;     &gt;&gt;&gt; c = Code()</span><br style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px"><span style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px">&gt;     &gt;&gt;&gt; c.return_(</span><br style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px">
<span style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px">&gt;     ...     TryExcept(</span><br style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px"><span style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px">&gt;     ...         Return(1),                                      # body</span><br style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px">
<span style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px">&gt;     ...         [(Const(KeyError),2), (Const(TypeError),3)],    # handlers</span><br style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px">
<span style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px">&gt;     ...         Return(4)                                       # else</span><br style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px">
<span style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px">&gt; clause</span><br style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px"><span style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px">&gt;     ...     )</span><br style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px">
<span style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px">&gt;     ... )</span><br></div><div style><span style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px"><br></span></div><div style>
<font color="#500050" face="arial, sans-serif">It was a typo as i replace both exceptions.KeyError and exceptions.TypeError with KeyError.</font></div><div style><font color="#500050" face="arial, sans-serif"><br></font></div>
<div style><font color="#500050" face="arial, sans-serif">As of running PEAK-Rules tests, i have trouble running them because the previous command does not find any. How do you run them actually ?</font></div><div style><font color="#500050" face="arial, sans-serif"><br>
</font></div><div style><font color="#500050" face="arial, sans-serif">Herve</font></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Mar 19, 2013 at 10:25 AM, PJ Eby <span dir="ltr">&lt;<a href="mailto:pje@telecommunity.com" target="_blank">pje@telecommunity.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On Tue, Mar 19, 2013 at 11:04 AM, Hervé Coatanhay<br>
&lt;<a href="mailto:herve.coatanhay@gmail.com">herve.coatanhay@gmail.com</a>&gt; wrote:<br>
&gt; FYI<br>
&gt;<br>
&gt; I did changes in README.txt to pass test. Mostly obvious ones, like print<br>
&gt; and types changes. But i had to replace DUP_TOPX with DUP_TOP_TWO (I&#39;m not<br>
&gt; entirely sure if that&#39;s OK).<br>
<br>
</div>Me either.  I haven&#39;t messed with py3 bytecode at all yet.  But if I<br>
understand correctly, DUP_TOPX(1) would map to DUP_TOP and DUP_TOPX(2)<br>
would map to DUP_TOP_TWO, but any larger number and it&#39;s more<br>
complicated than that.<br>
<div class="im"><br>
<br>
&gt; There are still some failing tests. One seems like some discrepancy between<br>
&gt; python2 and python3:<br>
&gt;<br>
&gt; In python2:<br>
&gt;&gt;&gt;&gt; exec(compile(&#39;42&#39;, &#39;&#39;, &#39;eval&#39;))<br>
&gt;&gt;&gt;&gt; eval(compile(&#39;42&#39;, &#39;&#39;, &#39;eval&#39;))<br>
&gt; 42<br>
&gt;<br>
&gt; In python3:<br>
&gt;&gt;&gt;&gt; exec(compile(&#39;42&#39;, &#39;&#39;, &#39;eval&#39;))<br>
&gt; 42<br>
&gt;&gt;&gt;&gt; eval(compile(&#39;42&#39;, &#39;&#39;, &#39;eval&#39;))<br>
&gt; 42<br>
<br>
</div>That one probably won&#39;t affect anything in PEAK-Rules.<br>
<div class="im"><br>
<br>
&gt; Other failing tests a related to the use of from_function classmethod. I&#39;m<br>
&gt; suspecting some issue with DecoratorTools because Decoratools tests are not<br>
&gt; passing. I&#39;ll try to make them pass.<br>
&gt;<br>
&gt; Finally, there are 2 tests failing that i don&#39;t know where to start with:<br>
&gt;<br>
&gt;     &gt;&gt;&gt; from peak.util.assembler import TryExcept<br>
&gt;     &gt;&gt;&gt; c = Code()<br>
&gt;     &gt;&gt;&gt; c.return_(<br>
&gt;     ...     TryExcept(<br>
&gt;     ...         Return(1),                                      # body<br>
&gt;     ...         [(Const(KeyError),2), (Const(TypeError),3)],    # handlers<br>
&gt;     ...         Return(4)                                       # else<br>
&gt; clause<br>
&gt;     ...     )<br>
&gt;     ... )<br>
<br>
</div>Not sure what&#39;s up with this one: the log you sent shows this actually<br>
having the same code (or at least as far as I can see).  It shouldn&#39;t<br>
be a whitespace difference, as I think the flags are set to ignore<br>
those.<br>
<div class="im"><br>
<br>
&gt;     &gt;&gt;&gt; c = Code()<br>
&gt;     &gt;&gt;&gt; c(1, True, 1.0, 1)     # equal, but different types<br>
&gt;     &gt;&gt;&gt; dis(c.code())<br>
<br>
</div>This is a 2to3 artifact: the original test had the fourth value as<br>
&quot;1L&quot;, which resulted in a fourth constant.  Python 3 doesn&#39;t have a<br>
distinct type for longs, so there&#39;s no way to create that value.  So<br>
this failure is of no consequence.<br>
<br>
Anyway, what about PEAK-Rules&#39; own tests?  It&#39;s got quite a lot of<br>
them, including for the criteria and predicate and indexing systems.<br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>dyslectics have more fnu
</div>