[Python-3000] Python 3.0 Porting Strategies

Talin talin at acm.org
Thu Mar 27 07:17:31 CET 2008


Martin v. Löwis wrote:
>> For new code, however, there is an alternative strategy that doesn't 
>> involve 2to3 at all, which is to write code in the "greatest common 
>> subset" of 2.6 and 3.0.
>>>> As Lennart Regbro pointed out earlier, this common subset is actually 
>> quite large (larger than Guido originally intended, I think), and you 
>> can write some fairly substantial applications in it.
>> I think it's worth noting that the subset is large only for 3.0 and 2.6.
> If you need to support 2.5 as well, the subset is significantly smaller;
> and if you also want to support 2.4, the subset is again even smaller.

I'm assuming not only 2.6, but 2.6 with all of the various __future__ 
imports enabled. Anything less than that is not worth considering from a 
practical standpoint. Yes, you can avoid things like print (just don't 
call it), but you can't realistically avoid strings and exceptions in a 
non-trivial program.
> Regards,
> Martin
>


More information about the Python-3000 mailing list

AltStyle によって変換されたページ (->オリジナル) /