[Python-Dev] Common subset of python 2 and python 3
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. 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@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
Re: [Python-Dev] Common subset of python 2 and python 3
On Sun, Jan 12, 2014 at 3:58 PM, Nick Coghlan wrote: > > On 12 Jan 2014 23:39, "Nachshon David Armon" > wrote: >> >> 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 > data). while that is true, it is possible to program unicode correctly in python 2 while remaining compatible with python 3. (a combination of "from future import unicode_literal" and properly using the encode and decode functions.). I would prefer a stripped version of python 3 that does not support anything that will really conflict with python 2. for porting purposes only of course. my employer still uses python 2 so the idea is to force other developers to use something that will force working on both during the transition without every single one having to be extra careful to support both versions. ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com