METADATA 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241
  1. Metadata-Version: 2.1
  2. Name: lazy-object-proxy
  3. Version: 1.10.0
  4. Summary: A fast and thorough lazy object proxy.
  5. Home-page: https://github.com/ionelmc/python-lazy-object-proxy
  6. Author: Ionel Cristian Mărieș
  7. Author-email: contact@ionelmc.ro
  8. License: BSD-2-Clause
  9. Project-URL: Documentation, https://python-lazy-object-proxy.readthedocs.io/
  10. Project-URL: Changelog, https://python-lazy-object-proxy.readthedocs.io/en/latest/changelog.html
  11. Project-URL: Issue Tracker, https://github.com/ionelmc/python-lazy-object-proxy/issues
  12. Classifier: Development Status :: 5 - Production/Stable
  13. Classifier: Intended Audience :: Developers
  14. Classifier: License :: OSI Approved :: BSD License
  15. Classifier: Operating System :: Unix
  16. Classifier: Operating System :: POSIX
  17. Classifier: Operating System :: Microsoft :: Windows
  18. Classifier: Programming Language :: Python
  19. Classifier: Programming Language :: Python :: 3
  20. Classifier: Programming Language :: Python :: 3 :: Only
  21. Classifier: Programming Language :: Python :: 3.8
  22. Classifier: Programming Language :: Python :: 3.9
  23. Classifier: Programming Language :: Python :: 3.10
  24. Classifier: Programming Language :: Python :: 3.11
  25. Classifier: Programming Language :: Python :: 3.12
  26. Classifier: Programming Language :: Python :: Implementation :: CPython
  27. Classifier: Programming Language :: Python :: Implementation :: PyPy
  28. Classifier: Topic :: Utilities
  29. Requires-Python: >=3.8
  30. License-File: LICENSE
  31. License-File: AUTHORS.rst
  32. ========
  33. Overview
  34. ========
  35. A fast and thorough lazy object proxy.
  36. * Free software: BSD 2-Clause License
  37. Note that this is based on `wrapt`_'s ObjectProxy with one big change: it calls a function the first time the proxy object is
  38. used, while `wrapt.ObjectProxy` just forwards the method calls to the target object.
  39. In other words, you use `lazy-object-proxy` when you only have the object way later and you use `wrapt.ObjectProxy` when you
  40. want to override few methods (by subclassing) and forward everything else to the target object.
  41. Example::
  42. import lazy_object_proxy
  43. def expensive_func():
  44. from time import sleep
  45. print('starting calculation')
  46. # just as example for a very slow computation
  47. sleep(2)
  48. print('finished calculation')
  49. # return the result of the calculation
  50. return 10
  51. obj = lazy_object_proxy.Proxy(expensive_func)
  52. # function is called only when object is actually used
  53. print(obj) # now expensive_func is called
  54. print(obj) # the result without calling the expensive_func
  55. Installation
  56. ============
  57. ::
  58. pip install lazy-object-proxy
  59. Documentation
  60. =============
  61. https://python-lazy-object-proxy.readthedocs.io/
  62. Development
  63. ===========
  64. To run all the tests run::
  65. tox
  66. Acknowledgements
  67. ================
  68. This project is based on some code from `wrapt`_ as you can see in the git history.
  69. .. _wrapt: https://github.com/GrahamDumpleton/wrapt
  70. Changelog
  71. =========
  72. 1.10.0 (2023-12-15)
  73. -------------------
  74. * Added Python 3.12 wheels.
  75. * Dropped support for Python 3.7.
  76. * Applied some reformatting and lint fixes using ruff to the codebase (mostly more Python 2 leftover cleanups).
  77. 1.9.0 (2023-01-04)
  78. ------------------
  79. * Added support for matrix multiplication operator (``@``).
  80. * Should have all the wheels now (including the manylinux ones).
  81. * Bumped minimum version requirements for setuptools and setuptools-scm.
  82. * Switched the default pure python fallback implementation to the "simple" one (when you ``from lazy_object_proxy import Proxy``
  83. and the C extension is not available).
  84. Previously the "slots" implementation was used but as it turns out it is slower on Python 3.
  85. 1.8.0 (2022-10-26)
  86. ------------------
  87. * Cleaned up use of cPickle. Contributed by Sandro Tosi in `#62 <https://github.com/ionelmc/python-lazy-object-proxy/pull/62>`_.
  88. * Cleaned up more dead Python 2 code.
  89. * Added Python 3.11 wheels.
  90. * Dropped support for Python 3.6.
  91. 1.7.1 (2021-12-15)
  92. ------------------
  93. * Removed most of the Python 2 support code and fixed ``python_requires`` to require at least Python 3.6.
  94. Note that 1.7.0 has been yanked because it could not install on Python 2.7.
  95. Installing lazy-object-proxy on Python 2.7 should automatically fall back to the 1.6.0 release now.
  96. 1.7.0 (2021-12-15)
  97. ------------------
  98. * Switched CI to GitHub Actions, this has a couple consequences:
  99. * Support for Python 2.7 is dropped. You can still install it there but it's not tested anymore and
  100. Python 2 specific handling will be removed at some point.
  101. * Linux wheels are now provided in `musllinux` and `manylinux2014` variants.
  102. * Fixed ``__index__`` to fallback to ``int`` if the wrapped object doesn't have an ``__index__`` method.
  103. This prevents situations where code using a proxy would otherwise likely just call ``int`` had the object
  104. not have an ``__index__`` method.
  105. 1.6.0 (2021-03-22)
  106. ------------------
  107. * Added support for async special methods (``__aiter__``, ``__anext__``,
  108. ``__await__``, ``__aenter__``, ``__aexit__``).
  109. These are used in the ``async for``, ``await` and ``async with`` statements.
  110. Note that ``__await__`` returns a wrapper that tries to emulate the crazy
  111. stuff going on in the ceval loop, so there will be a small performance overhead.
  112. * Added the ``__resolved__`` property. You can use it to check if the factory has
  113. been called.
  114. 1.5.2 (2020-11-26)
  115. ------------------
  116. * Added Python 3.9 wheels.
  117. * Removed Python 2.7 Windows wheels
  118. (not supported on newest image with Python 3.9).
  119. 1.5.1 (2020-07-22)
  120. ------------------
  121. * Added ARM64 wheels (manylinux2014).
  122. 1.5.0 (2020-06-05)
  123. ------------------
  124. * Added support for ``__fspath__``.
  125. * Dropped support for Python 3.4.
  126. 1.4.3 (2019-10-26)
  127. ------------------
  128. * Added binary wheels for Python 3.8.
  129. * Fixed license metadata.
  130. 1.4.2 (2019-08-22)
  131. ------------------
  132. * Included a ``pyproject.toml`` to allow users install the sdist with old python/setuptools, as the
  133. setuptools-scm dep will be fetched by pip instead of setuptools.
  134. Fixes `#30 <https://github.com/ionelmc/python-lazy-object-proxy/issues/30>`_.
  135. 1.4.1 (2019-05-10)
  136. ------------------
  137. * Fixed wheels being built with ``-coverage`` cflags. No more issues about bogus ``cext.gcda`` files.
  138. * Removed useless C file from wheels.
  139. * Changed ``setup.py`` to use setuptools-scm.
  140. 1.4.0 (2019-05-05)
  141. ------------------
  142. * Fixed ``__mod__`` for the slots backend. Contributed by Ran Benita in
  143. `#28 <https://github.com/ionelmc/python-lazy-object-proxy/pull/28>`_.
  144. * Dropped support for Python 2.6 and 3.3. Contributed by "hugovk" in
  145. `#24 <https://github.com/ionelmc/python-lazy-object-proxy/pull/24>`_.
  146. 1.3.1 (2017-05-05)
  147. ------------------
  148. * Fix broken release (``sdist`` had a broken ``MANIFEST.in``).
  149. 1.3.0 (2017-05-02)
  150. ------------------
  151. * Speed up arithmetic operations involving ``cext.Proxy`` subclasses.
  152. 1.2.2 (2016-04-14)
  153. ------------------
  154. * Added `manylinux <https://www.python.org/dev/peps/pep-0513/>`_ wheels.
  155. * Minor cleanup in readme.
  156. 1.2.1 (2015-08-18)
  157. ------------------
  158. * Fix a memory leak (the wrapped object would get bogus references). Contributed by Astrum Kuo in
  159. `#10 <https://github.com/ionelmc/python-lazy-object-proxy/pull/10>`_.
  160. 1.2.0 (2015-07-06)
  161. ------------------
  162. * Don't instantiate the object when __repr__ is called. This aids with debugging (allows one to see exactly in
  163. what state the proxy is).
  164. 1.1.0 (2015-07-05)
  165. ------------------
  166. * Added support for pickling. The pickled value is going to be the wrapped object *without* any Proxy container.
  167. * Fixed a memory management issue in the C extension (reference cycles weren't garbage collected due to improper
  168. handling in the C extension). Contributed by Alvin Chow in
  169. `#8 <https://github.com/ionelmc/python-lazy-object-proxy/pull/8>`_.
  170. 1.0.2 (2015-04-11)
  171. -----------------------------------------
  172. * First release on PyPI.