User: Password:
|
|
Subscribe / Log in / New account

catch 22: it's not just too hard

catch 22: it's not just too hard

Posted Feb 9, 2011 20:41 UTC (Wed) by amtota (subscriber, #4012)
Parent article: Moving to Python 3

I can't bear the costs of maintaining two versions of my software, so I don't... and I stick with python2.x

And I suspect that is the main reason why so few have made the jump: there is no real incentive. There are no killer features (for most) and there is a huge cost associated with supporting python3.x
If there was a way to support both versions in the same codebase cleanly, I would have done it by now, but there isn't. (exception handling is one sticky point, there are others)

To be honest, I don't see any easy way out of this one. Complaining that authors don't make the porting effort is barking up the wrong tree.


(Log in to post comments)

catch 22: it's not just too hard

Posted Feb 9, 2011 21:17 UTC (Wed) by iabervon (subscriber, #722) [Link]

I'm not seeing anything related to exception handling where you can't make the same code work with both 2.x and 3.x, although there are certainly changes from traditional style needed. What in particular are you thinking of?

catch 22: it's not just too hard

Posted Feb 9, 2011 22:53 UTC (Wed) by mmcgrath (subscriber, #44906) [Link]

> I'm not seeing anything

in fairness time is invisible.

catch 22: it's not just too hard

Posted Feb 9, 2011 23:24 UTC (Wed) by Webexcess (subscriber, #197) [Link]

I'm also curious what changes to exception handling are causing you trouble. The minor change to the except syntax is taken care of by 2to3 and using BaseException as the base class of your exceptions works on versions at least as early as 2.4.

It does take a lot of work to do, and you have to restrict your programming style to maintain compatibility. If I didn't have help I'm sure I wouldn't have made much progress at it. More and more projects do support both major versions from the same code base. It certainly can be done, it will just be ugly for a while.

upgrade to ugly code?

Posted Feb 11, 2011 13:16 UTC (Fri) by amtota (subscriber, #4012) [Link]

> It certainly can be done, it will just be ugly for a while.
And here lies the heart of my complaint: what sort of "upgrade" makes your code harder to read and maintain?


Copyright © 2018, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds