Python 2 vs Python 3 for teaching

Ben Finney ben+python at benfinney.id.au
Sun Nov 1 17:48:42 EST 2015


<paul.hermeneutic at gmail.com> writes:

> This would make an excellent opportunity to develop a curriculum to
> teach students how to maintain a 2.x and 3.x code base using 2to3.

The advice today reflects the great progress that has been made over
many years of migrating projects and organisations to Python 3.

Instead of ‘2to3’, the best advice today is: write new code targeting
Python 3 directly, and only if necessary back-port to Python 2.

> 2.x is not going away as fast as some would like.

Likewise, Python 3 as a primary development target is not as difficult
as some would fear.

Python 2 is unarguably a legacy platform, but it has good support for
receiving code carefully targeting both Python 2 and Python 3. So it's
best to target Python 3 primarily, and back-port code to Python 2 only
as and when needed.

-- 
 \       “We jealously reserve the right to be mistaken in our view of |
  `\      what exists, given that theories often change under pressure |
_o__)              from further investigation.” —Thomas W. Clark, 2009 |
Ben Finney




More information about the Python-list mailing list