Beginner needs advice

Steven D'Aprano steve+comp.lang.python at pearwood.info
Sat May 28 01:40:15 EDT 2011


On Fri, 27 May 2011 20:02:39 -0500, harrismh777 wrote:

> But the true picture is that 3.x is (way better) and completely
> incompatible with 2.x.   Lying about this isn't helpful to anyone coming
> on board with Python. Just tell them the truth...

Take your own advice and stop accusing others of lying when it is you 
spreading falsehoods about Python 3.

It is simply NOT TRUE that Python 3 is "completely incompatible" with 
Python 2. You keep making this accusation, but even the most cursory look 
at Python syntax, keywords, built-in objects, execution model, and 
standard library show that most things keep the same interface, and most 
of the remainder change in backward compatible ways.

There are some backwards incompatibilities, but nearly all of them can be 
resolved by an automated fixer, no human intelligence required.

Far from being "completely incompatible", the truth is that Python 2.7 
and 3.2 are more like 99% compatible. This is why there are 168 
identical .py files in the Python 2.7 and 3.2a standard libraries.

[steve at sylar ~]$ diff -rqbs --exclude="*.py[co]" /usr/local/lib/
python2.7/ /usr/local/lib/python3.2/ | grep identical | grep \\.py | wc -l
168


Calling Python 2 and Python 3 "different languages", as you have done, is 
simply wrong. Lisp and Python are different languages; Ruby and Python 
are different languages. Forth and Python are different languages. Python 
2 and 3 are not. They are the same language that share nearly everything 
in common but have a few significant differences.

Calling them "completely incompatible" is completely inaccurate.



-- 
Steven



More information about the Python-list mailing list