Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!feeder.news-service.com!xlned.com!feeder5.xlned.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.017 X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; 'python': 0.08; '+0200,': 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; 'wrote:': 0.14; 'library': 0.15; 'associating': 0.16; 'from:addr:yahoo.com.ar': 0.16; 'fri,': 0.23; 'objects': 0.23; 'url:library': 0.31; 'header:X-Complaints-To:1': 0.32; 'to:addr :python-list': 0.33; "isn't": 0.33; 'nobody': 0.34; 'there': 0.35; 'header:User-Agent:1': 0.35; 'skip:" 10': 0.35; 'using': 0.35; 'url:docs': 0.37; 'url:python': 0.38; 'received:org': 0.38; 'url:org': 0.38; 'subject:: ': 0.38; 'called': 0.39; 'header:Mime- Version:1': 0.39; 'to:addr:python.org': 0.39; 'subject:, ': 0.60; 'concept': 0.73; 'received:190': 0.74; '-0300,': 0.84; 'genellina': 0.84; 'gabriel': 0.91 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: "Gabriel Genellina" Subject: Re: except KeyError, everywhere Date: Tue, 07 Jun 2011 00:45:36 -0300 References: Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1; format=flowed; delsp=yes Content-Transfer-Encoding: 8bit X-Gmane-NNTP-Posting-Host: 190.2.4.25 User-Agent: Opera Mail/11.11 (Win32) 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: 19 NNTP-Posting-Host: 82.94.164.166 X-Trace: 1307418168 news.xs4all.nl 49178 [::ffff:82.94.164.166]:50531 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:7131 En Fri, 03 Jun 2011 21:02:56 -0300, Nobody escribió: > On Fri, 03 Jun 2011 22:08:16 +0200, Wilbert Berendsen wrote: > >> I find myself all over the place associating objects with each other >> using >> dicts as caches: > > The general concept is called "memoization". There isn't an > implementation > in the standard library Yes, there is, in Python 3.2: http://docs.python.org/py3k/library/functools.html#functools.lru_cache -- Gabriel Genellina