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


Groups > comp.lang.python > #105368

Re: Static caching property

Path csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail
From Ian Kelly <ian.g.kelly@gmail.com>
Newsgroups comp.lang.python
Subject Re: Static caching property
Date Mon, 21 Mar 2016 10:15:18 -0600
Lines 15
Message-ID <mailman.446.1458576961.12893.python-list@python.org> (permalink)
References <35a5c4206a0c40e584d62d5d37b068b3@activenetwerx.com>
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8
X-Trace news.uni-berlin.de VTdDaB0T4RL9noyl/ayMkw/tHejHzD9ixWa+qmzYzDRQ==
Return-Path <ian.g.kelly@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.008
X-Spam-Evidence '*H*': 0.98; '*S*': 0.00; 'static': 0.03; 'cache': 0.05; '21,': 0.07; 'descriptor': 0.09; 'instances.': 0.09; '2016': 0.16; 'attribute?': 0.16; 'caching': 0.16; 'properties,': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'wrote:': 0.16; 'attribute': 0.18; 'decorator': 0.22; 'am,': 0.23; 'header:In- Reply-To:1': 0.24; 'mon,': 0.24; 'example': 0.26; 'message- id:@mail.gmail.com': 0.27; 'non': 0.32; 'class': 0.33; 'received:google.com': 0.35; 'instance': 0.35; 'protocol': 0.35; 'but': 0.36; 'instead': 0.36; 'received:209.85': 0.36; 'to:addr :python-list': 0.36; 'subject:: ': 0.37; 'method': 0.37; 'received:209.85.213': 0.37; 'received:209': 0.38; 'why': 0.39; 'to:addr:python.org': 0.40; 'mar': 0.65; 'results': 0.66; 'does?': 0.84; 'to:name:python': 0.84; 'technique': 0.93
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=D2sTRWUZkxo8AdzvPvfSlQ+NH7nNGU3sfeXPi42RqZQ=; b=mHPT4a/yyZN6v7S/ytEWgaCGqhY0+/GZH3vqkOPb5lKby0LxsqBJFqDQenAdn3Gz7f y3R036THZfFwnbcf01vxHOLw+BFn+ChkLGq6ToFNXHWheukWTTZi7Q10FqxQMBehIoDF EayQA+Q2od3zwqbMffhGW62oT0RVzmZLQRsbKS5C0vOSNIXrMMOQxZHbaCkJljsIco5H dJ1tH5V3lBSWMWMvRAsrjN8o97JF79bX78euAIFWTMEISZqCK5+Xn8ZkhfgMGQSZz323 Gx1iA3YRXI+66lfp5JQLzbbIyKggeuOPF+yeCw2tCR1d7QeY1TrPmx9wlY6IiU9F8Dzw jswg==
X-Google-DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=D2sTRWUZkxo8AdzvPvfSlQ+NH7nNGU3sfeXPi42RqZQ=; b=c/iajfITkgvaqiucHZfrAd6heQnzyU+1Clwo1OsK1VcPDQtm0L5QXg1gBOVTp36IqR tQW8FRhmIi9SlPRFvQobO9gWO2hOCjpV92gONeVCJkCqR9gjOkKjoataApsDS2PCOTHx Atc+0inU70wJ0CCIbFfNIRDFPWMaMgi5hGOVm8d4drCauDdrULNSZNK93aQSFLJNymPt s6UoyYyJq21PNmRLu7thPgsyig7BkIXqF1WXc9Xc2sDXnXWbnyWyhxMsx2iGShZUMoAi xoQE7u4yV2V3XSYO6pYoGj42ACy9mFoAtzCrGEj8aKGmhyu1JFRpuzQ37kjQyEv2q0fd 68NQ==
X-Gm-Message-State AD7BkJLJupBeUUSHeSJ5+sTxYP1vbsiKMB7PZ5SJLKb3JeomQ5+wKW9pzmDX+jejadQ6arpzMlHzzBQzjfFKhg==
X-Received by 10.50.61.177 with SMTP id q17mr13112255igr.68.1458576957909; Mon, 21 Mar 2016 09:15:57 -0700 (PDT)
In-Reply-To <35a5c4206a0c40e584d62d5d37b068b3@activenetwerx.com>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.21
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Xref csiph.com comp.lang.python:105368

Show key headers only | View raw


On Mon, Mar 21, 2016 at 9:38 AM, Joseph L. Casale
<jcasale@activenetwerx.com> wrote:
> With non static properties, you can use a decorator that overwrites the
> method on the instance with an attribute containing the methods return
> effectively caching it.

Can you give an example of what you mean?

> What technique for a static property can be used to accomplish what the
> descriptor protocol does?
>
> I need to cache the results of a method on a class across all instances.

Why not do the same thing but using a class attribute instead of an
instance attribute?

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


Thread

Re: Static caching property Ian Kelly <ian.g.kelly@gmail.com> - 2016-03-21 10:15 -0600
  Re: Static caching property Steven D'Aprano <steve@pearwood.info> - 2016-03-22 03:36 +1100
    Re: Static caching property "Joseph L. Casale" <jcasale@activenetwerx.com> - 2016-03-21 16:49 +0000
    Re: Static caching property Chris Angelico <rosuav@gmail.com> - 2016-03-22 03:54 +1100
    Re: Static caching property "Joseph L. Casale" <jcasale@activenetwerx.com> - 2016-03-21 17:03 +0000
    Re: Static caching property Ian Kelly <ian.g.kelly@gmail.com> - 2016-03-21 11:44 -0600
    Re: Static caching property Ethan Furman <ethan@stoneleaf.us> - 2016-03-21 10:45 -0700
    Re: Static caching property Ian Kelly <ian.g.kelly@gmail.com> - 2016-03-21 11:48 -0600
      Re: Static caching property Steven D'Aprano <steve@pearwood.info> - 2016-03-22 11:05 +1100
        Re: Static caching property Chris Angelico <rosuav@gmail.com> - 2016-03-22 11:15 +1100
        Re: Static caching property Ian Kelly <ian.g.kelly@gmail.com> - 2016-03-22 07:30 -0600

csiph-web