[Twisted-Python] Phasing out old-style classes

James Y Knight foom at fuhm.net
Sun Oct 25 01:50:15 EDT 2009


On Oct 25, 2009, at 1:38 AM, Glyph Lefkowitz wrote:
> What do you do?  Well, the obvious upgrade path here is to make a  
> class which (A) inherits from "Library" to get Twisted functionality  
> and (B) inherits from "object" to get new-style-ness.  So you go  
> ahead and write:
>
> # in your application
> class Application(object, Library): pass

Maybe the answer "why not" is obvious and I should already know it,  
but wouldn't it be more obvious to write:
class Application(Library, object): pass
instead. That at least has the advantage of not blowing up if Library  
later becomes newstyle, right?

James
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://twistedmatrix.com/pipermail/twisted-python/attachments/20091025/13a87d66/attachment.htm 


More information about the Twisted-Python mailing list