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


Groups > comp.lang.python > #105366

Static caching property

Path csiph.com!feeder.erje.net!2.eu.feeder.erje.net!newsfeed.freenet.ag!newsfeed0.kamp.net!newsfeed.kamp.net!fu-berlin.de!uni-berlin.de!not-for-mail
From "Joseph L. Casale" <jcasale@activenetwerx.com>
Newsgroups comp.lang.python
Subject Static caching property
Date Mon, 21 Mar 2016 15:38:33 +0000
Lines 12
Message-ID <mailman.444.1458575228.12893.python-list@python.org> (permalink)
Mime-Version 1.0
Content-Type text/plain; charset="iso-8859-1"
Content-Transfer-Encoding quoted-printable
X-Trace news.uni-berlin.de Bvf9/H48LLhT0iip20ThHwUuZNBP0eTu/JTR0DgRjNxQ==
Return-Path <jcasale@activenetwerx.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.99; '*S*': 0.00; 'static': 0.03; 'cache': 0.05; 'descriptor': 0.09; 'instances.': 0.09; 'caching': 0.16; 'properties,': 0.16; 'received:172.18.0': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'attribute': 0.18; 'to:name:python- list@python.org': 0.20; 'decorator': 0.22; 'thanks,': 0.24; 'non': 0.32; 'class': 0.33; 'instance': 0.35; 'protocol': 0.35; 'to:addr :python-list': 0.36; 'method': 0.37; 'to:addr:python.org': 0.40; 'results': 0.66; 'does?': 0.84; 'technique': 0.93
X-Authority-Analysis v=2.1 cv=VIR9547X c=1 sm=1 tr=0 a=g3mLq75WYuDrh3Lt0JSDww==:117 a=g3mLq75WYuDrh3Lt0JSDww==:17 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=P90J6pEA2ccA:10 a=8nJEP1OIZ-IA:10 a=7OsogOcEt9IA:10 a=m4udIxNb8FSZ6EMI3EcA:9 a=wPNLvfGTeEIA:10
X-Spam-Checker-Version SpamAssassin 3.4.0 (2014-02-07) on mail.activenetwerx.com
X-Spam-Level
X-Spam-Status No, score=-1.0 required=5.0 tests=ALL_TRUSTED,RP_MATCHES_RCVD autolearn=ham autolearn_force=no version=3.4.0
Thread-Topic Static caching property
Thread-Index AQHRg4dpC97vHCaJwEm/OBao3y7fUA==
Accept-Language en-CA, en-US
Content-Language en-CA
X-MS-Has-Attach
X-MS-TNEF-Correlator
x-originating-ip [172.18.0.4]
X-CMAE-Envelope MS4wfCDnNRIXyNPhuDf/ZPac0/HBu/BJGoMCX7x+Fa202qBqG7yrBmmxHHD5/hPnJhlZffubIHRihZkf7j/SPvkuBm06OfPP1UHUqADNb0qUsbbVrRSs1O0y Tos2Rg4s+Ii3NWqilWsCxsyX5dbs1LiaFiy0crjg8/Nz4hw5MQjom70NYDnmbQmQDQbGNBmNL6JWmg==
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:105366

Show key headers only | View raw


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.

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.

Thanks,
jlc

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


Thread

Static caching property "Joseph L. Casale" <jcasale@activenetwerx.com> - 2016-03-21 15:38 +0000

csiph-web