https://github.com/zopefoundation/zope.cachedescriptors
Python descriptors which cache their output, taking into account instance attributes that they depend on
https://github.com/zopefoundation/zope.cachedescriptors
maintained
Last synced: 8 months ago
JSON representation
Python descriptors which cache their output, taking into account instance attributes that they depend on
- Host: GitHub
- URL: https://github.com/zopefoundation/zope.cachedescriptors
- Owner: zopefoundation
- License: other
- Created: 2013-02-19T18:36:36.000Z (over 13 years ago)
- Default Branch: master
- Last Pushed: 2025-09-12T06:58:08.000Z (9 months ago)
- Last Synced: 2025-09-12T08:35:09.671Z (9 months ago)
- Topics: maintained
- Language: Python
- Homepage:
- Size: 233 KB
- Stars: 6
- Watchers: 62
- Forks: 8
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
- Changelog: CHANGES.rst
- Contributing: CONTRIBUTING.md
- License: LICENSE.txt
- Copyright: COPYRIGHT.txt
Awesome Lists containing this project
README
===========================
``zope.cachedescriptors``
===========================
.. image:: https://img.shields.io/pypi/v/zope.cachedescriptors.svg
:target: https://pypi.org/project/zope.cachedescriptors/
:alt: Latest release
.. image:: https://img.shields.io/pypi/pyversions/zope.cachedescriptors.svg
:target: https://pypi.org/project/zope.cachedescriptors/
:alt: Supported Python versions
.. image:: https://github.com/zopefoundation/zope.cachedescriptors/actions/workflows/tests.yml/badge.svg
:target: https://github.com/zopefoundation/zope.cachedescriptors/actions/workflows/tests.yml
.. image:: https://readthedocs.org/projects/zopehookable/badge/?version=latest
:target: http://zopehookable.readthedocs.io/en/latest/
:alt: Documentation Status
.. image:: https://coveralls.io/repos/github/zopefoundation/zope.cachedescriptors/badge.svg?branch=master
:target: https://coveralls.io/github/zopefoundation/zope.cachedescriptors?branch=master
Cached descriptors cache their output. They take into account
instance attributes that they depend on, so when the instance
attributes change, the descriptors will change the values they
return.
Cached descriptors cache their data in ``_v_`` attributes, so they are
also useful for managing the computation of volatile attributes for
persistent objects.
Persistent descriptors:
- ``property``
A simple computed property.
See ``src/zope/cachedescriptors/property.rst``.
- ``method``
Idempotent method. The return values are cached based on method
arguments and on any instance attributes that the methods are
defined to depend on.
.. note::
Only a cache based on arguments has been implemented so far.
See ``src/zope/cachedescriptors/method.rst``.