Path: csiph.com!usenet.pasdenom.info!news.redatomik.org!newsfeed.xs4all.nl!newsfeed3.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.023 X-Spam-Evidence: '*H*': 0.96; '*S*': 0.00; 'suppose': 0.07; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'customizing': 0.16; 'key=': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'subject:key': 0.16; 'header :User-Agent:1': 0.23; 'header:X-Complaints-To:1': 0.27; 'operations,': 0.30; 'comparison': 0.31; 'subject:?': 0.36; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'skip:u 10': 0.60; 'such': 0.63; 'skip:n 10': 0.64; 'provide': 0.64; 'repeat': 0.74; 'received:139': 0.84 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Neal Becker Subject: heapq - why no key= arg? Date: Mon, 27 Apr 2015 09:54:51 -0400 Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7Bit X-Gmane-NNTP-Posting-Host: exa2-in-fw-01-epn.hns.com User-Agent: KNode/4.14.6 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20+ 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: 8 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1430142902 news.xs4all.nl 2911 [2001:888:2000:d::a6]:48869 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:89457 Looking at heapq, I see only nlargest/nsmallest provide a key= arg. What about other operations, such as heapify? Am I not understanding something? I suppose for other ops, such as heapify, I can only customize comparison by customizing the object comparison operators? -- Those who fail to understand recursion are doomed to repeat it