[Twisted-Python] Phasing out old-style classes

Glyph Lefkowitz glyph at twistedmatrix.com
Thu Oct 8 20:08:12 EDT 2009


On Thu, Oct 8, 2009 at 7:59 PM, Mark Visser <markv at lumierevfx.com> wrote:

> Is there a project underway to modernize twisted?
>

Yes.  The project is called "twisted" :).  Personally I find that it is very
"modern".

I've been bitten a couple times by twisted's use of old-style classes.
> Now that Jython is finally off the 2.2 branch, is there any real reason
> to stay backwards compatible?
>

Changing a class from old-style to new-style is an incompatible change.  The
difficulty is that if existing libraries use a particular class and inherit
from it, changing the class to be new-style can have effects from changing
how their descriptors work to causing an exception when their module is
imported.

We have a compatibility policy, intended to prevent people's applications
from breaking when they upgrade Twisted:
http://twistedmatrix.com/trac/wiki/CompatibilityPolicy

If old-style classes can be evolved into new-style classes while somehow
following this policy, that would be great.  The problem is that providing
compatibility at this level is time-consuming and difficult.  One problem in
particular is that we don't want to litter the codebase with lots of "Foo"
and "NewFoo" or "Foo2" sitting right next to it, so we would have to think
of new names for everything.

If you have a particular interest in the new-style vs. old-style problem,
please feel free to submit patches!  This is one of those areas where we
need a continuous stream of small improvements from the community, because
it's just too much drudgework for the core team to take care of in our spare
time.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://twistedmatrix.com/pipermail/twisted-python/attachments/20091008/27523248/attachment.htm 


More information about the Twisted-Python mailing list