
Show HN: Python 3 with backwards compatibility features - nas
Porting Python code from version 2.x to 3.x is not a simple task.  To help, I built a version of Python 3.6 that includes backwards compatibility features.  Most important is the mixing of bytes and str objects and comparisons.  For example, in vanilla Python 3:<p><pre><code>  &gt;&gt;&gt; b&#x27;foo&#x27; + &#x27;bar&#x27;
  Traceback (most recent call last):
    File &quot;&lt;stdin&gt;&quot;, line 1, in &lt;module&gt;
  TypeError: can&#x27;t concat bytes to str
  &gt;&gt;&gt; None &lt; &#x27;hi&#x27;
  Traceback (most recent call last):
    File &quot;&lt;stdin&gt;&quot;, line 1, in &lt;module&gt;
  TypeError: unorderable types: NoneType() &lt; str()

</code></pre>
In my Python 3:<p><pre><code>  &gt;&gt;&gt; b&#x27;foo&#x27; + &#x27;bar&#x27;
  sys:1: DeprecationWarning: encoding bytes to str
  &#x27;foobar&#x27;
  &gt;&gt;&gt; None &lt; &#x27;hi&#x27;
  __main__:1: DeprecationWarning: default compare is depreciated
  True
</code></pre>
Certain changes are easy to fix with code converters like 2to3.  For example, changing print statements into functions is trivial.  I don&#x27;t bother trying to handle those.  There is still a lot of things that could be added.  However, when porting a large code base to Python 3, I found it useful.<p>I hope other people might use it and submit improvements.  If someone need pre-built binaries (e.g. Windows), I would be willing to do it.<p>https:&#x2F;&#x2F;github.com&#x2F;nascheme&#x2F;ppython
======
GroSacASacs
Good work, have you put it on PIP and Python Mailing list ?

------
lulzman206
This is what Python devs should have done...

