Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #106745

Re: how to convert code that uses cmp to python3

Path csiph.com!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail
From Marko Rauhamaa <marko@pacujo.net>
Newsgroups comp.lang.python
Subject Re: how to convert code that uses cmp to python3
Date Sat, 09 Apr 2016 19:32:56 +0300
Organization A noiseless patient Spider
Lines 12
Message-ID <87y48meo93.fsf@elektro.pacujo.net> (permalink)
References <57064D0D.1030701@rece.vub.ac.be> <CAPTjJmrGiQS9uhFU-+TQ4nUWQ2p4gmJoQitMotS0Ob--qm1iWg@mail.gmail.com> <5706C961.2000009@rece.vub.ac.be> <CAPTjJmrbL870mV1kU8nHar=bPyKZRmhKP-8iUs_tpYVo5vhhOA@mail.gmail.com> <57075F43.7060004@rece.vub.ac.be> <85fuuw5ypl.fsf@benfinney.id.au> <5707B2CE.1010407@rece.vub.ac.be> <CAPTjJmrMv5O5vwrbfHJJCdiHi87naPOanhPmk4Ba_SLRgu1m4Q@mail.gmail.com> <5707BE18.1050805@rece.vub.ac.be> <CAPTjJmoMuqwg0Q_fp=qitC3wWkXYHtdqBNVGzO+3ToAmsgit8Q@mail.gmail.com> <5708C8B0.6050904@rece.vub.ac.be> <85twjb3su5.fsf@benfinney.id.au> <570910E2.3030400@rece.vub.ac.be> <CAPTjJmqeWACzrzka+5kQxO9Co42k7jRJzG_+cCqHkYO2OtQtMw@mail.gmail.com> <57091EA8.4080803@rece.vub.ac.be> <CAPTjJmrS=HW2fhDgZw22n5kcS4c+=b71rV50DkPPkKRdRW+QqA@mail.gmail.com> <570927E4.9000104@rece.vub.ac.be> <mailman.128.1460217831.2253.python-list@python.org>
Mime-Version 1.0
Content-Type text/plain
Injection-Info mx02.eternal-september.org; posting-host="b7cb1518d23ec19d482dcc9c31d30fdd"; logging-data="7297"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19eFAyPt9Gmw9oQChg0xTjR"
User-Agent Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)
Cancel-Lock sha1:xwsjlUtPq+5BWsl5m8OAUCJIo10= sha1:BljVSZ8aHJiV23eAbc4X1OYxUc0=
Xref csiph.com comp.lang.python:106745

Show key headers only | View raw


Antoon Pardon <antoon.pardon@rece.vub.ac.be>:

> And when I need some personal object as a key, I can avoid the
> duplication by using some kind of cmp cache when I implement __lt__
> and family.

Yes, that's what you can do in rare, extreme cases where key comparison
takes a long time. For caching, you will simply need to require that
keys stay immutable wrt comparing.


Marko

Back to comp.lang.python | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Re: how to convert code that uses cmp to python3 Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2016-04-09 18:03 +0200
  Re: how to convert code that uses cmp to python3 Marko Rauhamaa <marko@pacujo.net> - 2016-04-09 19:32 +0300

csiph-web