METADATA 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219
  1. Metadata-Version: 2.1
  2. Name: lazy-object-proxy
  3. Version: 1.7.1
  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. Platform: UNKNOWN
  13. Classifier: Development Status :: 5 - Production/Stable
  14. Classifier: Intended Audience :: Developers
  15. Classifier: License :: OSI Approved :: BSD License
  16. Classifier: Operating System :: Unix
  17. Classifier: Operating System :: POSIX
  18. Classifier: Operating System :: Microsoft :: Windows
  19. Classifier: Programming Language :: Python
  20. Classifier: Programming Language :: Python :: 3 :: Only
  21. Classifier: Programming Language :: Python :: 3.6
  22. Classifier: Programming Language :: Python :: 3.7
  23. Classifier: Programming Language :: Python :: 3.8
  24. Classifier: Programming Language :: Python :: 3.9
  25. Classifier: Programming Language :: Python :: 3.10
  26. Classifier: Programming Language :: Python :: Implementation :: CPython
  27. Classifier: Programming Language :: Python :: Implementation :: PyPy
  28. Classifier: Topic :: Utilities
  29. Requires-Python: >=3.6
  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.7.1 (2021-12-15)
  73. ------------------
  74. * Removed most of the Python 2 support code and fixed ``python_requires`` to require at least Python 3.6.
  75. Note that 1.7.0 has been yanked because it could not install on Python 2.7.
  76. Installing lazy-object-proxy on Python 2.7 should automatically fall back to the 1.6.0 release now.
  77. 1.7.0 (2021-12-15)
  78. ------------------
  79. * Switched CI to GitHub Actions, this has a couple consequences:
  80. * Support for Python 2.7 is dropped. You can still install it there but it's not tested anymore and
  81. Python 2 specific handling will be removed at some point.
  82. * Linux wheels are now provided in `musllinux` and `manylinux2014` variants.
  83. * Fixed ``__index__`` to fallback to ``int`` if the wrapped object doesn't have an ``__index__`` method.
  84. This prevents situations where code using a proxy would otherwise likely just call ``int`` had the object
  85. not have an ``__index__`` method.
  86. 1.6.0 (2021-03-22)
  87. ------------------
  88. * Added support for async special methods (``__aiter__``, ``__anext__``,
  89. ``__await__``, ``__aenter__``, ``__aexit__``).
  90. These are used in the ``async for``, ``await` and ``async with`` statements.
  91. Note that ``__await__`` returns a wrapper that tries to emulate the crazy
  92. stuff going on in the ceval loop, so there will be a small performance overhead.
  93. * Added the ``__resolved__`` property. You can use it to check if the factory has
  94. been called.
  95. 1.5.2 (2020-11-26)
  96. ------------------
  97. * Added Python 3.9 wheels.
  98. * Removed Python 2.7 Windows wheels
  99. (not supported on newest image with Python 3.9).
  100. 1.5.1 (2020-07-22)
  101. ------------------
  102. * Added ARM64 wheels (manylinux2014).
  103. 1.5.0 (2020-06-05)
  104. ------------------
  105. * Added support for ``__fspath__``.
  106. * Dropped support for Python 3.4.
  107. 1.4.3 (2019-10-26)
  108. ------------------
  109. * Added binary wheels for Python 3.8.
  110. * Fixed license metadata.
  111. 1.4.2 (2019-08-22)
  112. ------------------
  113. * Included a ``pyproject.toml`` to allow users install the sdist with old python/setuptools, as the
  114. setuptools-scm dep will be fetched by pip instead of setuptools.
  115. Fixes `#30 <https://github.com/ionelmc/python-lazy-object-proxy/issues/30>`_.
  116. 1.4.1 (2019-05-10)
  117. ------------------
  118. * Fixed wheels being built with ``-coverage`` cflags. No more issues about bogus ``cext.gcda`` files.
  119. * Removed useless C file from wheels.
  120. * Changed ``setup.py`` to use setuptools-scm.
  121. 1.4.0 (2019-05-05)
  122. ------------------
  123. * Fixed ``__mod__`` for the slots backend. Contributed by Ran Benita in
  124. `#28 <https://github.com/ionelmc/python-lazy-object-proxy/pull/28>`_.
  125. * Dropped support for Python 2.6 and 3.3. Contributed by "hugovk" in
  126. `#24 <https://github.com/ionelmc/python-lazy-object-proxy/pull/24>`_.
  127. 1.3.1 (2017-05-05)
  128. ------------------
  129. * Fix broken release (``sdist`` had a broken ``MANIFEST.in``).
  130. 1.3.0 (2017-05-02)
  131. ------------------
  132. * Speed up arithmetic operations involving ``cext.Proxy`` subclasses.
  133. 1.2.2 (2016-04-14)
  134. ------------------
  135. * Added `manylinux <https://www.python.org/dev/peps/pep-0513/>`_ wheels.
  136. * Minor cleanup in readme.
  137. 1.2.1 (2015-08-18)
  138. ------------------
  139. * Fix a memory leak (the wrapped object would get bogus references). Contributed by Astrum Kuo in
  140. `#10 <https://github.com/ionelmc/python-lazy-object-proxy/pull/10>`_.
  141. 1.2.0 (2015-07-06)
  142. ------------------
  143. * Don't instantiate the object when __repr__ is called. This aids with debugging (allows one to see exactly in
  144. what state the proxy is).
  145. 1.1.0 (2015-07-05)
  146. ------------------
  147. * Added support for pickling. The pickled value is going to be the wrapped object *without* any Proxy container.
  148. * Fixed a memory management issue in the C extension (reference cycles weren't garbage collected due to improper
  149. handling in the C extension). Contributed by Alvin Chow in
  150. `#8 <https://github.com/ionelmc/python-lazy-object-proxy/pull/8>`_.
  151. 1.0.2 (2015-04-11)
  152. -----------------------------------------
  153. * First release on PyPI.