<div dir="ltr">So from what I'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='+ELLIPSIS,+NORMALIZE_WHITESPACE'</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">> >>> 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">> >>> 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">> >>> 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">> ... 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">> ... 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">> ... [(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">> ... 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">> 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">> ... )</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">> ... )</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"><<a href="mailto:pje@telecommunity.com" target="_blank">pje@telecommunity.com</a>></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>
<<a href="mailto:herve.coatanhay@gmail.com">herve.coatanhay@gmail.com</a>> wrote:<br>
> FYI<br>
><br>
> I did changes in README.txt to pass test. Mostly obvious ones, like print<br>
> and types changes. But i had to replace DUP_TOPX with DUP_TOP_TWO (I'm not<br>
> entirely sure if that's OK).<br>
<br>
</div>Me either. I haven'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's more<br>
complicated than that.<br>
<div class="im"><br>
<br>
> There are still some failing tests. One seems like some discrepancy between<br>
> python2 and python3:<br>
><br>
> In python2:<br>
>>>> exec(compile('42', '', 'eval'))<br>
>>>> eval(compile('42', '', 'eval'))<br>
> 42<br>
><br>
> In python3:<br>
>>>> exec(compile('42', '', 'eval'))<br>
> 42<br>
>>>> eval(compile('42', '', 'eval'))<br>
> 42<br>
<br>
</div>That one probably won't affect anything in PEAK-Rules.<br>
<div class="im"><br>
<br>
> Other failing tests a related to the use of from_function classmethod. I'm<br>
> suspecting some issue with DecoratorTools because Decoratools tests are not<br>
> passing. I'll try to make them pass.<br>
><br>
> Finally, there are 2 tests failing that i don't know where to start with:<br>
><br>
> >>> from peak.util.assembler import TryExcept<br>
> >>> c = Code()<br>
> >>> c.return_(<br>
> ... TryExcept(<br>
> ... Return(1), # body<br>
> ... [(Const(KeyError),2), (Const(TypeError),3)], # handlers<br>
> ... Return(4) # else<br>
> clause<br>
> ... )<br>
> ... )<br>
<br>
</div>Not sure what'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't<br>
be a whitespace difference, as I think the flags are set to ignore<br>
those.<br>
<div class="im"><br>
<br>
> >>> c = Code()<br>
> >>> c(1, True, 1.0, 1) # equal, but different types<br>
> >>> dis(c.code())<br>
<br>
</div>This is a 2to3 artifact: the original test had the fourth value as<br>
"1L", which resulted in a fourth constant. Python 3 doesn't have a<br>
distinct type for longs, so there's no way to create that value. So<br>
this failure is of no consequence.<br>
<br>
Anyway, what about PEAK-Rules' own tests? It'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>