Name | Date | Size | #Lines | LOC | ||
---|---|---|---|---|---|---|
.. | 03-May-2022 | - | ||||
.github/ | H | 22-Mar-2021 | - | 2 | 1 | |
ci/ | H | 03-May-2022 | - | 362 | 305 | |
docs/ | H | 03-May-2022 | - | 101 | 77 | |
src/ | H | 22-Mar-2021 | - | 2,622 | 1,800 | |
tests/ | H | 22-Mar-2021 | - | 3,771 | 2,485 | |
.appveyor.yml | H A D | 18-Mar-2021 | 4.9 KiB | 151 | 149 | |
.bumpversion.cfg | H A D | 22-Mar-2021 | 547 | 22 | 16 | |
.cookiecutterrc | H A D | 17-Mar-2021 | 1.6 KiB | 54 | 52 | |
.coveragerc | H A D | 17-Mar-2021 | 149 | 15 | 12 | |
.editorconfig | H A D | 17-Mar-2021 | 353 | 21 | 16 | |
.gitignore | H A D | 17-Mar-2021 | 715 | 78 | 65 | |
.pre-commit-config.yaml | H A D | 17-Mar-2021 | 554 | 21 | 20 | |
.readthedocs.yml | H A D | 17-Mar-2021 | 231 | 11 | 10 | |
.travis.yml | H A D | 18-Mar-2021 | 4 KiB | 166 | 165 | |
AUTHORS.rst | H A D | 17-Mar-2021 | 278 | 11 | 8 | |
CHANGELOG.rst | H A D | 22-Mar-2021 | 3 KiB | 103 | 70 | |
CONTRIBUTING.rst | H A D | 17-Mar-2021 | 2.7 KiB | 92 | 58 | |
LICENSE | H A D | 17-Mar-2021 | 1.3 KiB | 22 | 16 | |
PKG-INFO | H A D | 22-Mar-2021 | 7 KiB | 194 | 137 | |
README.rst | H A D | 22-Mar-2021 | 3.9 KiB | 120 | 83 | |
conftest.py | H A D | 18-Mar-2021 | 203 | 11 | 6 | |
pyproject.toml | H A D | 18-Mar-2021 | 103 | 7 | 6 | |
setup.cfg | H A D | 03-May-2022 | 821 | 49 | 43 | |
setup.py | H A D | 22-Mar-2021 | 4.8 KiB | 139 | 110 | |
tox.ini | H A D | 18-Mar-2021 | 2.4 KiB | 115 | 105 |
README.rst
1======== 2Overview 3======== 4 5.. start-badges 6 7.. list-table:: 8 :stub-columns: 1 9 10 * - docs 11 - |docs| 12 * - tests 13 - | |travis| |appveyor| |requires| 14 | |coveralls| |codecov| 15 * - package 16 - | |version| |wheel| |supported-versions| |supported-implementations| 17 | |commits-since| 18.. |docs| image:: https://readthedocs.org/projects/python-lazy-object-proxy/badge/?style=flat 19 :target: https://readthedocs.org/projects/python-lazy-object-proxy 20 :alt: Documentation Status 21 22.. |travis| image:: https://api.travis-ci.com/ionelmc/python-lazy-object-proxy.svg?branch=master 23 :alt: Travis-CI Build Status 24 :target: https://travis-ci.com/github/ionelmc/python-lazy-object-proxy 25 26.. |appveyor| image:: https://ci.appveyor.com/api/projects/status/github/ionelmc/python-lazy-object-proxy?branch=master&svg=true 27 :alt: AppVeyor Build Status 28 :target: https://ci.appveyor.com/project/ionelmc/python-lazy-object-proxy 29 30.. |requires| image:: https://requires.io/github/ionelmc/python-lazy-object-proxy/requirements.svg?branch=master 31 :alt: Requirements Status 32 :target: https://requires.io/github/ionelmc/python-lazy-object-proxy/requirements/?branch=master 33 34.. |coveralls| image:: https://coveralls.io/repos/ionelmc/python-lazy-object-proxy/badge.svg?branch=master&service=github 35 :alt: Coverage Status 36 :target: https://coveralls.io/r/ionelmc/python-lazy-object-proxy 37 38.. |codecov| image:: https://codecov.io/gh/ionelmc/python-lazy-object-proxy/branch/master/graphs/badge.svg?branch=master 39 :alt: Coverage Status 40 :target: https://codecov.io/github/ionelmc/python-lazy-object-proxy 41 42.. |version| image:: https://img.shields.io/pypi/v/lazy-object-proxy.svg 43 :alt: PyPI Package latest release 44 :target: https://pypi.org/project/lazy-object-proxy 45 46.. |wheel| image:: https://img.shields.io/pypi/wheel/lazy-object-proxy.svg 47 :alt: PyPI Wheel 48 :target: https://pypi.org/project/lazy-object-proxy 49 50.. |supported-versions| image:: https://img.shields.io/pypi/pyversions/lazy-object-proxy.svg 51 :alt: Supported versions 52 :target: https://pypi.org/project/lazy-object-proxy 53 54.. |supported-implementations| image:: https://img.shields.io/pypi/implementation/lazy-object-proxy.svg 55 :alt: Supported implementations 56 :target: https://pypi.org/project/lazy-object-proxy 57 58.. |commits-since| image:: https://img.shields.io/github/commits-since/ionelmc/python-lazy-object-proxy/v1.6.0.svg 59 :alt: Commits since latest release 60 :target: https://github.com/ionelmc/python-lazy-object-proxy/compare/v1.5.2...master 61 62 63 64.. end-badges 65 66A fast and thorough lazy object proxy. 67 68* Free software: BSD 2-Clause License 69 70Note that this is based on `wrapt`_'s ObjectProxy with one big change: it calls a function the first time the proxy object is 71used, while `wrapt.ObjectProxy` just forwards the method calls to the target object. 72 73In other words, you use `lazy-object-proxy` when you only have the object way later and you use `wrapt.ObjectProxy` when you 74want to override few methods (by subclassing) and forward everything else to the target object. 75 76Example:: 77 78 import lazy_object_proxy 79 80 def expensive_func(): 81 from time import sleep 82 print('starting calculation') 83 # just as example for a very slow computation 84 sleep(2) 85 print('finished calculation') 86 # return the result of the calculation 87 return 10 88 89 obj = lazy_object_proxy.Proxy(expensive_func) 90 # function is called only when object is actually used 91 print(obj) # now expensive_func is called 92 93 print(obj) # the result without calling the expensive_func 94 95Installation 96============ 97 98:: 99 100 pip install lazy-object-proxy 101 102Documentation 103============= 104 105https://python-lazy-object-proxy.readthedocs.io/ 106 107Development 108=========== 109 110To run all the tests run:: 111 112 tox 113 114Acknowledgements 115================ 116 117This project is based on some code from `wrapt`_ as you can see in the git history. 118 119.. _wrapt: https://github.com/GrahamDumpleton/wrapt 120