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


Groups > comp.lang.python > #33430

Re: Lazy Attribute

Path csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <stefan@epy.co.at>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.009
X-Spam-Evidence '*H*': 0.98; '*S*': 0.00; 'url:pypi': 0.03; 'attribute': 0.05; 'decorator': 0.07; 'pypi': 0.07; 'welcome.': 0.07; 'python': 0.09; ';-)': 0.11; 'to:name:python-list': 0.15; 'class:': 0.16; 'wrote:': 0.17; 'stefan': 0.17; 'putting': 0.20; 'basis,': 0.22; 'header:In-Reply-To:1': 0.25; 'wondering': 0.26; 'post': 0.28; 'once.': 0.29; 'received:192.168.1.3': 0.29; 'url:2012': 0.30; 'url:python': 0.32; 'comments': 0.33; 'to:addr :python-list': 0.33; 'there': 0.35; 'url:org': 0.36; 'alone': 0.36; 'charset:us-ascii': 0.36; 'does': 0.37; 'subject:: ': 0.38; 'shows': 0.38; 'to:addr:python.org': 0.39; 'received:192': 0.39; 'received:192.168': 0.40; 'your': 0.60; 'header:Message-Id:1': 0.62; 'url:blogspot': 0.64; 'cut': 0.71; 'received:at': 0.71; 'url:11': 0.71; 'demand': 0.96
Content-Type text/plain; charset=us-ascii
Mime-Version 1.0 (Apple Message framework v1085)
Subject Re: Lazy Attribute
From "Stefan H. Holek" <stefan@epy.co.at>
In-Reply-To <DUB117-W881D7D74D529D159D8B33F91520@phx.gbl>
Date Fri, 16 Nov 2012 11:41:50 +0100
Content-Transfer-Encoding quoted-printable
References <DUB117-W881D7D74D529D159D8B33F91520@phx.gbl>
To python-list <python-list@python.org>
X-Mailer Apple Mail (2.1085)
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://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 <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.3747.1353063984.27098.python-list@python.org> (permalink)
Lines 25
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1353063984 news.xs4all.nl 6868 [2001:888:2000:d::a6]:44223
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:33430

Show key headers only | View raw


On 15.11.2012, at 20:33, Andriy Kornatskyy wrote:

> A lazy attribute is an attribute that is calculated on demand and only once.
> 
> The post below shows how you can use lazy attribute in your Python class:
> 
> http://mindref.blogspot.com/2012/11/python-lazy-attribute.html
> 
> Comments or suggestions are welcome.

There is a ready made and well tested lazy decorator at http://pypi.python.org/pypi/lazy. I even has a better name. ;-)

Since people seem to come up with their own implementations on a bi-weekly basis, I am seriously wondering how to improve its visibility. Putting it on PyPI alone does not cut it, apparently.

Stefan

-- 
Stefan H. Holek
stefan@epy.co.at

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


Thread

Re: Lazy Attribute "Stefan H. Holek" <stefan@epy.co.at> - 2012-11-16 11:41 +0100

csiph-web