On 5/29/2014 12:03 AM, Steven D'Aprano wrote:
On Wed, 28 May 2014 20:41:53 -0400, Terry Reedy wrote:

Claim: Another great strength of Python 2 was that programs written in
it would almost always run on the next version of Python without much


True, but only because of the weasel-words "almost always", and "without
much alteration".

And for the record, for many (although not all) programs written in
Python 2.7, it is still true that they will often run in Python 3 with
little or no modification.

Changes and removals of deprecated features (like old style
classes) were put off until 3.0 (at the request of some of the noiser

I am specifically thinking of int / int -> float, which Guido initially proposed for 2.5 after warnings in 2.3, 2.4. The idea of 3.0 with more breakage and 2to3 emerged during that discussion.

That's a little unfair. Noisy users or not, Python Dev has always taken
backwards compatibility seriously.

Nevertheless, there have been some big changes to Python 2.x that
*didn't* wait for 3.x to break backwards compatibility. A few examples
that come to mind:

- removing string exceptions for good in 2.6;
- changes to the treatment in hex() of negative numbers;
- the repr() of floats;
- changes to the sequence of random numbers generated by the
   random number module (e.g. while random.random() is
   guaranteed to return the same sequence of values,
   random.choice is not);
- removal of obsolete modules like bastion and rotor.

Any and all of these things can break code that relies on them.

Terry Jan Reedy


Reply via email to