<html><head></head><body><div style="color:#000; background-color:#fff; font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:16px"><div dir="ltr" id="yui_3_16_0_1_1455023487497_2667"><span id="yui_3_16_0_1_1455023487497_2936">There are many "gotchas" going from Python 2 to Python 3 - with the change from "print" to "print()" being by far the most irritating (and the most stringently enforced by the Python interpreter). There are several IDEs which can highlight problems and give tips to migrate from Python 2 to Python 3, or to write code that is compatible for both (in many cases, you can use "try.... except..." - if the Python 2 code crashes, you simply try to execute the Python 3 statement thereafter).</span></div><div id="yui_3_16_0_1_1455023487497_2935" dir="ltr"><br><span></span></div><div id="yui_3_16_0_1_1455023487497_2722" dir="ltr"><span id="yui_3_16_0_1_1455023487497_2723">It is one of the "features" of the Python language that it is not supposed to be necessarily backward compatible, but obsolescent features and new features are announced with very generous transition periods, so that programmers have sufficient time to update their code. Unfortunately, the long lead time causes programmers to become lazy, since in practice, obsolescent features are supported for a long time, thus it is not necessary to update the code immediately.</span></div><div id="yui_3_16_0_1_1455023487497_2989" dir="ltr"><br><span id="yui_3_16_0_1_1455023487497_2723"></span></div><div id="yui_3_16_0_1_1455023487497_2990" dir="ltr"><span id="yui_3_16_0_1_1455023487497_2723">For those who are interested: Python is a forward compatible language, where the statement:</span></div><div dir="ltr"><br><span id="yui_3_16_0_1_1455023487497_2723"></span></div><div id="yui_3_16_0_1_1455023487497_3073" dir="ltr"><span id="yui_3_16_0_1_1455023487497_2723">from __future__ import bla</span></div><div id="yui_3_16_0_1_1455023487497_3102" dir="ltr"><br><span id="yui_3_16_0_1_1455023487497_2723"></span></div><div id="yui_3_16_0_1_1455023487497_3103" dir="ltr"><span id="yui_3_16_0_1_1455023487497_2723">can be used to import the "bla" name; in this way, you can use bla before it becomes part of the official Python language, which (potentially) saves work in future code revisions. Obviously it takes an expert to know what __future__ functions there are and whether or not it is worthwhile to use them.<br></span></div><div id="yui_3_16_0_1_1455023487497_2824" dir="ltr"><span id="yui_3_16_0_1_1455023487497_2723"><br></span></div><div id="yui_3_16_0_1_1455023487497_3136" dir="ltr"><span id="yui_3_16_0_1_1455023487497_2723">Wilfred</span></div> <div class="qtdSeparateBR"><br><br></div><div style="display: block;" class="yahoo_quoted"> <div style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 16px;"> <div style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 16px;"> <div dir="ltr"><font face="Arial" size="2"> On Tuesday, February 9, 2016 7:00 PM, Philip TAYLOR <P.Taylor@Rhul.Ac.Uk> wrote:<br></font></div> <blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; margin-top: 5px; padding-left: 5px;"> <br><br> <div class="y_msg_container">Hallo Khaled --<br clear="none"><br clear="none">Khaled Hosny wrote:<br clear="none">> There are many other Python 3 incompatibilities in the code (this <br clear="none">> being Python, you will not encounter them until the code in question <br clear="none">> is actually being executed, which can be deceiving). Regards, Khaled <br clear="none"><br clear="none">Yes, I fully appreciate that; all I was trying to do was suggest some <br clear="none">simple zero-effort code that could be added to indicate whether the <br clear="none">system version of Python was compatible with the code as written and <br clear="none">issue an appropriate diagnostic; it was in no way an attempt to re-write <br clear="none">the code such as to make it compatible with both Python 2 and Python 3 <br clear="none">other than at the most superficial (lexical) level.<div class="yqt0145011458" id="yqtfd62199"><br clear="none"><br clear="none">** Phil.<br clear="none"><br clear="none"><br clear="none"><br clear="none"><br clear="none">--------------------------------------------------<br clear="none">Subscriptions, Archive, and List information, etc.:<br clear="none">  <a shape="rect" href="http://tug.org/mailman/listinfo/xetex" target="_blank">http://tug.org/mailman/listinfo/xetex</a><br clear="none"></div><br><br></div> </blockquote> </div> </div>  </div></div></body></html>