This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Backwards compatibility
Type: compile error Stage: resolved
Components: Versions: Python 3.1
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: Raven, amaury.forgeotdarc, ezio.melotti, georg.brandl, vstinner
Priority: normal Keywords:

Created on 2010-06-23 09:51 by Raven, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (5)
msg108444 - (view) Author: Raven Demeyer (Raven) Date: 2010-06-23 09:51
Python 3 is not backwards compatible with Python 2.

Example:
Python 2: print 'foo'
Python 3: print(bar)

Problem:
Code written for Python during version 2 cannot be used/compiled in version 3

Solution:
Just like any decent self-respecting programming language, add backwards compatibility.
msg108446 - (view) Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) * (Python committer) Date: 2010-06-23 10:08
as stated in
http://www.python.org/download/releases/3.1.2/
python 3 is designed to be backwards incompatible.

I suggest you to follow the link "Conversion tool for Python 2.x code".
msg108447 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2010-06-23 10:37
> Code written for Python during version 2 cannot be 
> used/compiled in version 3

Use 2to3 script to convert your Python2 program to Python3. More information at:
http://docs.python.org/py3k/whatsnew/3.0.html#porting-to-python-3-0
msg108448 - (view) Author: Ezio Melotti (ezio.melotti) * (Python committer) Date: 2010-06-23 10:44
Python 2 is also forward compatible with several Python 3 features, for example:

>>> from __future__ import print_function
>>> print('foo')
foo
msg108778 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2010-06-27 10:34
Please, do not feed the trolls.
History
Date User Action Args
2022-04-11 14:57:02adminsetgithub: 53305
2010-06-27 10:34:23georg.brandlsetnosy: + georg.brandl
messages: + msg108778
2010-06-23 10:44:05ezio.melottisetnosy: + ezio.melotti
messages: + msg108448

components: - Regular Expressions
stage: resolved
2010-06-23 10:37:24vstinnersetnosy: + vstinner
messages: + msg108447
2010-06-23 10:08:51amaury.forgeotdarcsetstatus: open -> closed

nosy: + amaury.forgeotdarc
messages: + msg108446

resolution: not a bug
2010-06-23 09:51:11Ravencreate