There is no simple and perfect way to really test that fully now.

Some things that can be done right now in the code of packages :

* check that print is used in a python3 compatible way
* check that cmp() is not used
* check that .iteritems, .iterkeys are not used

An useful diagnostic tool is "2to3" ; another one is "pep8" (to find 
deprecated syntax, for example syntax of raise).
Another way is to try to launch your module using "python -3".

The best way forward is to move as quickly as possible to a working 
python3+sage. We still have for example to make sage doctest system work 
with python3.

Frederic

https://stackoverflow.com/questions/40886456/how-to-detect-if-code-is-python-3-compatible
https://stackoverflow.com/questions/40815079/checking-code-for-compatibility-with-python-2-and-3



Le samedi 14 octobre 2017 11:51:01 UTC+2, John Cremona a écrit :
>
> How can we be sure that new code witten by people (like me) who are 
> not python2/3 experts does not regress? 
>
> Also, I can see that projects which build on top of Sage will one day 
> have to make sure that their code is all python3-compliant (I am 
> thinking of the LMFDB).  What's the simplest way of testing that now, 
> to see where the issues will lie? 
>
> John 
>
> On 13 October 2017 at 20:19, 'Julien Puydt' via sage-devel 
> <sage-...@googlegroups.com <javascript:>> wrote: 
> > Hi, 
> > 
> > Le 13/10/2017 à 17:56, Frédéric Chapoton a écrit : 
> >> Cool, no ? Or maybe nobody cares ? 
> > 
> > Extremely cool! 
> > 
> >> Many things are still not working. The cmp problem has been much 
> >> reduced, but still not fully fixed. On our way is a large-scale unicode 
> >> problem, and maybe another large scale hash problem. 
> > 
> > Why are unicode and hash problems? 
> > 
> > Snark on #sagemath 
> > 
> > -- 
> > You received this message because you are subscribed to the Google 
> Groups "sage-devel" group. 
> > To unsubscribe from this group and stop receiving emails from it, send 
> an email to sage-devel+...@googlegroups.com <javascript:>. 
> > To post to this group, send email to sage-...@googlegroups.com 
> <javascript:>. 
> > Visit this group at https://groups.google.com/group/sage-devel. 
> > For more options, visit https://groups.google.com/d/optout. 
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to