Guido rethinking removal of cmp from sort method

Paul Rubin no.email at nospam.invalid
Fri Apr 1 03:45:24 EDT 2011


Chris Angelico <rosuav at gmail.com> writes:
> Provably false. Even a well-designed interface, if it is asked to deal
> with a changing implementation and changing requirements, will
> eventually either acquire cruft, or be found too rigid to be of use.

What happens then is you define a new interface.  In Microsoft-speak if
the IWhatever interface needs an incompatible extension like new
parameters, they introduce IWhatever2 which supports the new parameters.
They change the implementation of IWhatever so it becomes a wrapper for
IWhatever2 setting the new parameters to default values, to keep
implementing the old behavior.

Removing cmp certainly isn't the most disruptive change of Python 3,
but it seems like the one with the least benefit.



More information about the Python-list mailing list