Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.dougwise.org!gegeweb.org!aioe.org!feeder.news-service.com!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'behavior.': 0.07; 'terry': 0.07; 'wrapper': 0.07; 'internally': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:80.91.229.12': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'received:lo.gmane.org': 0.09; 'subject:method': 0.09; 'values,': 0.09; 'am,': 0.14; 'extension': 0.14; 'wrote:': 0.14; 'cmp': 0.16; 'functools': 0.16; 'incompatible': 0.16; 'parameters,': 0.16; 'reedy': 0.16; 'subject:sort': 0.16; 'versus': 0.16; 'interface': 0.20; '(or': 0.22; 'jan': 0.22; 'header:In-Reply-To:1': 0.22; 'parameters.': 0.23; 'implementing': 0.25; 'define': 0.26; 'parameters': 0.26; 'changed': 0.27; 'supports': 0.29; 'interface.': 0.29; 'probably': 0.30; 'concern.': 0.31; 'key,': 0.31; 'paul': 0.32; 'import': 0.32; 'to:addr:python-list': 0.32; 'header:X-Complaints-To:1': 0.34; 'change': 0.34; 'header:User- Agent:1': 0.35; 'skip:. 10': 0.36; 'setting': 0.36; 'some': 0.37; 'but': 0.38; 'happens': 0.38; 'received:org': 0.38; 'to:addr:python.org': 0.39; 'could': 0.39; 'header:Mime- Version:1': 0.39; 'would': 0.40; 'header:Received:5': 0.40; 'introduce': 0.78; 'gain': 0.80; 'subject:removal': 0.84 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Terry Reedy Subject: Re: Guido rethinking removal of cmp from sort method Date: Fri, 01 Apr 2011 14:57:48 -0400 References: <4d7cbfcb$0$29971$c3e8da3$5496439d@news.astraweb.com> <4d94326c$0$30003$c3e8da3$5496439d@news.astraweb.com> <7x8vvue7or.fsf@ruckus.brouhaha.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: rain.gmane.org User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.15) Gecko/20110303 Lightning/1.0b2 Thunderbird/3.1.9 In-Reply-To: <7x8vvue7or.fsf@ruckus.brouhaha.com> X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 28 NNTP-Posting-Host: 82.94.164.166 X-Trace: 1301684281 news.xs4all.nl 41117 [::ffff:82.94.164.166]:44099 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:2381 On 4/1/2011 3:45 AM, Paul Rubin wrote: > What happens then is you define a new interface. Like key= versus cmp= > 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. If cmp had been left (or were reinstated) but its implementation changed internally to use cmp_to_key to make it a wrapper for key, you would be happy? 2to3 could probably gain a fixer to change .sort(cmp=f) # to import functools import cmp_to_key .sort(key=functools.cmp_to_key(f)) I know some would not like this because interface change is not their real concern. -- Terry Jan Reedy