[Python-ideas] Create Python 2.8 as a transition step to Python 3.x

Neil Schemenauer nas-python at arctrix.com
Sat Jan 18 04:22:19 CET 2014


The transition to Python 3 is happening but there is still a massive
amount of code that needs to be ported.  One of the most disruptive
changes in Python 3 is the strict separation of bytes from unicode
strings.  Most of the other incompatible changes can be handled by
2to3.

Here is a far out idea to make transition smoother.  Release version
2.8 of Python with nearly all Python 3.x incompatible changes except
for the bytes/unicode changes.  This could include:

- print as function

- default string literal as unicode

- return view objects for dict.keys(), etc

- rename modules in standard library

- rename long to int

- rename .next() to __next__()

- accept only new 'raise' syntax

- remove backticks for repr

- rename unicode to str

- removal of 'apply', 'buffer', 'callable', 'execfile'

- exec as function

- rename os.getcwdu() to os.getcwd()

- remove dict.has_key

- move intern to sys.intern()

- rename xrange to range

- remove xreadlines

New features of Python 3.x could be backported if easy since they
could be useful to entice developers to move from 2.7 to 2.8.

Problems with this idea:

- it would be a huge amount of work.  There are thousands of
  commits to Python 3.x since it was branched.  Most of them are not
  related to the above features but back porting them would still be
  a huge effort.  I tried backport 'print' as a function just to get
  an idea of the work.

- if people install this new version of Python as the default, old
  scripts and programs will break.  I believe this breakage was the
  movation for making Python 3 an all-at-once jump.  I'm not sure
  how to handle this, maybe this version could be used only by
  developers during their Python 3 porting efforts.  Alternatively,
  only install it as 'python2.8', never 'python' or 'python2'.

An alternative approach to producing Python 2.8 would be to start
with the Python 3.x latest branch.  Modify bytesobject and
unicodeobject to have as close to Python 2 behavior as practical.

A-journey-of-a-thousand-miles-begins-ly y'rs

  Neil


More information about the Python-ideas mailing list