[Python-3000] u'text' as an alias for 'text'?

"Martin v. Löwis" martin at v.loewis.de
Mon Mar 24 00:25:54 CET 2008


>>  If you add __future__ imports to the 2.6 code, it will stop running
>>  on 2.5. Does that make it "not backwards compatible", or "not forwards
>>  compatible".
> 
> That makes it not backwards compatible, and it makes it forwards compatible.

Just to get the terminology straight:

Python x.y is forwards compatible iff all programs written for Python
x.y will run on Python a.b, with a>x or a=x and b>y.

Correct?

>> You develop for 2.6, and then make sure it runs on 3.0 -
>> *exactly* the same as for 2.5/2.6.
> 
> Uh... no. You develop for 2.5, and then you don't do anything else. It
> *will* run under 2.6. No need to check. Because it's backwards
> compatible. And 3.0 is not. So it's definitely not the same. However,
> if 2.6 were forwards compatible, this would be true for the 2.6 to 3.0
> port.

There is no way on earth Python 2.6 can be forwards compatible. Even
a simple program like

open("/etc/passwd").read().decode("ascii")

will work differently (i.e. raise an exception in 3k).

AFAIR, no Python release ever was forwards-compatible, by the definition
above. It was always possible to construct programs that ran in the old
version, but changed their behavior in the new version.

Or, more precisely, 2.x.0 was "mostly" forwards compatible with 2.x.n,
except for behavior changes involving bug fixes.

Regards,
Martin



More information about the Python-3000 mailing list