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 23:24 UTC (Wed) by Webexcess (guest, #197)
In reply to: catch 22: it's not just too hard by amtota
Parent article: Moving to Python 3

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.


(Log in to post comments)

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 © 2017, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds