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

Nick Coghlan ncoghlan at gmail.com
Mon Mar 24 02:37:07 CET 2008


Lennart Regebro wrote:
> On Sun, Mar 23, 2008 at 10:52 PM, "Martin v. Löwis" <martin at v.loewis.de> wrote:
>> 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.

This is only true if you aren't using anything from 2.4 or earlier that 
was deprecated in 2.5 and then removed entirely in 2.6. For example, the 
following code snippet may work in 2.5, but gives a Syntax Error in 2.6 
(as with statements are now available without a __future__ import):

  with = self.get_something()
  self.do_action(with)

You always need to test on both to be certain of code compatibility - 
this isn't something new with the 2.6/3.0 transition. The only 
difference is that working with 3.0 currently involves a compilation step.

Cheers,
Nick.

-- 
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia
---------------------------------------------------------------
             http://www.boredomandlaziness.org


More information about the Python-3000 mailing list