1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100
|
Metadata-Version: 1.1
Name: memoized-property
Version: 1.0.3
Summary: A simple python decorator for defining properties that only run their fget function once
Home-page: https://github.com/estebistec/python-memoized-property
Author: Steven Cummings
Author-email: cummingscs@gmail.com
License: BSD
Description: =================
memoized_property
=================
.. image:: https://badge.fury.io/py/memoized-property.png
:target: http://badge.fury.io/py/memoized-property
.. image:: https://travis-ci.org/estebistec/python-memoized-property.png?branch=master
:target: https://travis-ci.org/estebistec/python-memoized-property
.. image:: https://pypip.in/d/memoized-property/badge.png
:target: https://crate.io/packages/memoized-property?version=latest
A simple python decorator for defining properties that only run their fget function once.
* Free software: BSD license
What?
-----
A Python property that only calls its ``fget`` function one time. How many times have you written
this code (or similar)?
::
def class C(object):
@property
def name(self):
if not hasattr(self, '_name'):
self._name = some_expensive_load()
return self._name
I've written it just enough times to be annoyed enough to capture this module. The result is this::
from memoized_property import memoized_property
def class C(object):
@memoized_property
def name(self):
# Boilerplate guard conditional avoided, but this is still only called once
return some_expensive_load()
Why?
----
I couldn't find a pre-existing version of this on PyPI. I found one other on GitHub,
https://github.com/ytyng/python-memoized-property, but it was not published to PyPI.
History
-------
1.0.3 (2016-09-28)
++++++++++++++++++
* Build universal wheels
* Support Python 3.4, 3.5
1.0.2 (2014-05-02)
++++++++++++++++++
* Remove dependency on six
1.0.1 (2014-01-01)
++++++++++++++++++
* Added python 3.2 compatability
1.0.0 (2013-12-26)
++++++++++++++++++
* First release on PyPI.
Keywords: memoized property decorator
Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: BSD License
Classifier: Natural Language :: English
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.6
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.2
Classifier: Programming Language :: Python :: 3.3
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
|