[Python-ideas] Smoothing transition to Python 3
Nick Coghlan
ncoghlan at gmail.com
Thu Jun 9 20:24:14 EDT 2016
On 9 June 2016 at 15:35, Carl Meyer <carl at oddbird.net> wrote:
> On 06/09/2016 04:20 PM, Nick Coghlan wrote:
>> While it's theoretically possible to support 2.4+ and 3.x in the same
>> code base, it's painful in practice due to the lack of the forward
>> compatibility features added in Python 2.6 (such as the Python 3 style
>> syntax for name binding in except clauses)
>
> While I agree that it's by far the best option to raise the minimum
> supported version to 2.6 (or even 2.7) before trying to straddle to 3,
> we shouldn't make it sound impossible to straddle all the way back to
> 2.4. It's painful, for sure, but every issue is surmountable if you're
> dedicated enough. E.g. if you need to capture the exception in an
> `except` clause, you use `sys.exc_info()` instead. Pip did that for
> years :-)
Right, but there's also a time related aspect to this advice: most
folks enthusiastic enough about Python 3 to adopt those kinds of
invasive measures already support it, and Python 2.4 is now several
years older than it was when folks first started adding Python 3
support to their projects (even RHEL 5 is reaching the point where Red
Hat starts requiring the Extended Life Support addon for ongoing
support beyond March 2017).
That means that for anyone that's still holding off on porting due to
a desire to retain Python 2.4 compatibility, "wait 12 months or so,
and then reassess our need to support Python 2.4" is likely to make
more sense than putting a lot of work into supporting Python 2.4 and
3.x in the same code base. Similarly, maintaining a Python 3
compatibility changeset with a reasonable hope of being able to merge
it back into the parent project sometime in the next year is a
significantly more attractive option than creating and maintaining a
full fork of the project indefinitely.
Cheers,
Nick.
--
Nick Coghlan | ncoghlan at gmail.com | Brisbane, Australia
More information about the Python-ideas
mailing list