[Twisted-Python] Some "spread" objects and comparison semantics

exarkun at twistedmatrix.com exarkun at twistedmatrix.com
Wed May 11 13:05:22 EDT 2011


On 10 May, 06:51 pm, facundobatista at gmail.com wrote:
>I'm analysing the code in twisted/spread/flavors.py and
>twisted/spread/pb.py, trying to remove the __cmp__ and cmp() in
>RemoteCache, RemoteCacheMethod and RemoteCacheObserver classes.
>
>They all have __cmp__ methods, but as there is not any test for these,
>and it's not specified in the documentation, I don't know if the
>comparison method is to compare by equality, or for these objects to
>be orderable.
>
>Yes, I could replace __cmp__ with the full rich comparison battery,
>but it's not worth it if the semantic of these objects will not use
>it.

I doubt anyone remembers the rationale for these methods.  We should err 
on the safe side and preserve the existing behavior.

Jean-Paul



More information about the Twisted-Python mailing list