<div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">Does Python 3 have feature we want to use in LLVM codebase, and no workaround there? If so, please give some examples. I think that makes the discussion more concrete.</div></div><div class="gmail_extra"><br><div class="gmail_quote">2018-01-30 4:46 GMT+08:00 Fāng-ruì Sòng via llvm-dev <span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi LLVM-Devs,<br>
<br>
I noticed that many Python scripts under utils/ have a shebang of<br>
`#!/usr/bin/python` (which is a symlink to python2.7 on many platforms) and some of them use Python 2 syntax that is not compatible with Python 3 (e.g. print statements; str/bytes)<br>
<br>
I created a revision to migrate utils/update_{llc_,}_test_chec<wbr>ks.py from Python 2 to Python 3 <a href="https://reviews.llvm.org/D42450" rel="noreferrer" target="_blank">https://reviews.llvm.org/D4245<wbr>0</a> , the arguments against making it Python 3 is:<br>
<br>
* There are many Mac OS X users and Mac OS X 10.8 comes with Python 2.7 pre-installed [0] but not Python 3.<br>
* Forcing scripts to use Python 3 (by doing so we can avoid some compatibility trouble) may not be a good idea.<br>
<br>
Python 2.7 was published in 2010 and planned as the last of the 2.x releases. It will not be maintained past 2020 and there is also a retirement page <a href="https://pythonclock.org/" rel="noreferrer" target="_blank">https://pythonclock.org/</a> .<br>
<br>
The second argument would not need to be addressed if the first one did not lay too much burden on developers. After all, we have to install `cmake, ninja/GNU Make / libedit(for lldb)` to build LLVM. These packages are not installed by default on many platforms.<br>
<br>
Thoughts on deprecating Python 2 for utils/ scripts (different from libclang or lldb scripts) which are not user-facing?<br>
<br>
[0]: <a href="https://docs.python.org/3/using/mac.html#getting-and-installing-macpython" rel="noreferrer" target="_blank">https://docs.python.org/3/usin<wbr>g/mac.html#getting-and-install<wbr>ing-macpython</a><br>
<br>
<br>
Thanks,<br>
Fangrui<br>
______________________________<wbr>_________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-dev</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div>Wei-Ren Chen (陳韋任)<br>Homepage: <a href="https://people.cs.nctu.edu.tw/~chenwj" target="_blank">https://people.cs.nctu.edu.tw/~chenwj</a></div></div></div>
</div>