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