[Python-Dev] Common subset of python 2 and python 3

Nick Coghlan ncoghlan at gmail.com
Sun Jan 12 14:58:09 CET 2014

On 12 Jan 2014 23:39, "Nachshon David Armon" <nachshon.armon at gmail.com>
> Hi,
> I am Nachshon and this is my first post to the python mailing list.
> I have been porting some libraries from python 2 to python 3 recently
with the goal of a common codebase that will run on both versions. I was
thinking it would make my life, and a lot of other developers as well, a
lot easier if there were a version of python that supported ONLY the
features found both in python 2 and python 3. It should be a developer only
version of python.
> It should use unicode strings and require that people use the from
__future__ syntax so that anything written in it will work in python 2.7
and in python 3.3+.
> Regarding name changes of standard library modules it should support the
new stuff and have helper functions and guides that make the old modules
likethe new ones. it should encourage using backports of the new standard
library modules like enum so that developers are not stuck for features.
> I propose that this new version of python use the python 3 unicode model.
As the version of python will be fully compatible with both python 2 and
with python 3 but NOT necsesarily with all existing code in either. It is
designed as a porting tool only.

Ah, I missed this on the first read through - that combination of
requirements doesn't quite make sense (the text models are fundamentally
incompatible in a way that forces developers to resolve ambiguities that
Python 2 would silently tolerate until it hit a bad combination of input

You may want to take a look at the "python-future" project - that comes as
close as anything else I am aware of to allowing you to write Python 2 code
that reads like idiomatic Python 3 code.


> I suggest that this new python version should be called python 2 and 9
tenths. Is it worth it for me to write a pep that suggests this?
> _______________________________________________
> Python-Dev mailing list
> Python-Dev at python.org
> https://mail.python.org/mailman/listinfo/python-dev
> Unsubscribe:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20140112/44bd1594/attachment-0001.html>

More information about the Python-Dev mailing list