[Twisted-Python] Ways to register stuff only done for backwards compatibility

Laurens Van Houtven _ at lvh.cc
Tue Jul 5 08:32:36 EDT 2011


Hi,


In doing twisted.positioning I find my self writing a bunch of code in ways
I would ordinarily write it differently, because we have to support 2.4
still (when is that going away? Isn't the most recent RHEL 2.6 already?).

Is there some way to register that so that as soon as we stop supporting
2.4, we can make a lot of code a lot prettier? For certain functions such as
any/all, perhaps a twisted.python._backports (with the explicit mention that
code in backports will go away as soon as the version it's built to work
around is no longer supported). That way, as soon as you support 2.5 (which
has any/all), you just remove it from _backports, see which tests break,
remove the imports, run tests again, commit. Woo!

Of course, _backports is obviously not a solution for everything, since not
every language feature can be fixed by defining a class or a function
somewhere.

cheers
lvh
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://twistedmatrix.com/pipermail/twisted-python/attachments/20110705/15d74c5b/attachment.htm 


More information about the Twisted-Python mailing list