This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

A fast and thorough lazy object proxy.

Project Description

A fast and thorough lazy object proxy.

  • Free software: BSD license

Note that this is based on wrapt’s ObjectProxy with one big change: it calls a function the first time the proxy object is used, while wrapt.ObjectProxy just forwards the method calls to the target object.

In other words, you use lazy-object-proxy when you only have the object way later and you use wrapt.ObjectProxy when you want to override few methods (by subclassing) and forward everything else to the target object.

Example:

def expensive_func():
    # create expensive object
    return stuff

obj = lazy_object_proxy.Proxy(expensive_func)
# function is called only when object is actually used
print(obj.foobar)  # now expensive_func is called

Installation

pip install lazy-object-proxy

Development

To run the all tests run:

tox

Acknowledgements

This project is based on some code from wrapt as you can see in the git history.

Changelog

1.3.1 (2017-05-05)

  • Fix broken release (sdist had a broken MANIFEST.in).

1.3.0 (2017-05-02)

  • Speed up arithmetic operations involving cext.Proxy subclasses.

1.2.2 (2016-04-14)

  • Added manylinux wheels.
  • Minor cleanup in readme.

1.2.1 (2015-08-18)

  • Fix a memory leak (the wrapped object would get bogus references). Contributed by Astrum Kuo in #10.

1.2.0 (2015-07-06)

  • Don’t instantiate the object when __repr__ is called. This aids with debugging (allows one to see exactly in what state the proxy is).

1.1.0 (2015-07-05)

  • Added support for pickling. The pickled value is going to be the wrapped object without any Proxy container.
  • Fixed a memory management issue in the C extension (reference cycles weren’t garbage collected due to improper handling in the C extension). Contributed by Alvin Chow in #8.

1.0.2 (2015-04-11)

  • First release on PyPI.
Release History

Release History

This version
History Node

1.3.1

History Node

1.3.0

History Node

1.2.2

History Node

1.2.1

History Node

1.2.0

History Node

1.1.0

History Node

1.0.2

History Node

1.0.1

History Node

1.0.0

History Node

0.1.0

History Node

0.0.1

Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
lazy_object_proxy-1.3.1-cp26-cp26m-manylinux1_i686.whl (51.1 kB) Copy SHA256 Checksum SHA256 cp26 Wheel May 5, 2017
lazy_object_proxy-1.3.1-cp26-cp26m-manylinux1_x86_64.whl (56.5 kB) Copy SHA256 Checksum SHA256 cp26 Wheel May 5, 2017
lazy_object_proxy-1.3.1-cp26-cp26mu-manylinux1_i686.whl (51.1 kB) Copy SHA256 Checksum SHA256 cp26 Wheel May 5, 2017
lazy_object_proxy-1.3.1-cp26-cp26mu-manylinux1_x86_64.whl (56.5 kB) Copy SHA256 Checksum SHA256 cp26 Wheel May 5, 2017
lazy_object_proxy-1.3.1-cp26-cp26m-win32.whl (22.4 kB) Copy SHA256 Checksum SHA256 cp26 Wheel May 5, 2017
lazy_object_proxy-1.3.1-cp26-cp26m-win_amd64.whl (23.9 kB) Copy SHA256 Checksum SHA256 cp26 Wheel May 5, 2017
lazy_object_proxy-1.3.1-cp27-cp27m-manylinux1_i686.whl (51.1 kB) Copy SHA256 Checksum SHA256 cp27 Wheel May 5, 2017
lazy_object_proxy-1.3.1-cp27-cp27m-manylinux1_x86_64.whl (56.5 kB) Copy SHA256 Checksum SHA256 cp27 Wheel May 5, 2017
lazy_object_proxy-1.3.1-cp27-cp27mu-manylinux1_i686.whl (51.1 kB) Copy SHA256 Checksum SHA256 cp27 Wheel May 5, 2017
lazy_object_proxy-1.3.1-cp27-cp27mu-manylinux1_x86_64.whl (56.5 kB) Copy SHA256 Checksum SHA256 cp27 Wheel May 5, 2017
lazy_object_proxy-1.3.1-cp27-cp27m-win32.whl (22.2 kB) Copy SHA256 Checksum SHA256 cp27 Wheel May 5, 2017
lazy_object_proxy-1.3.1-cp27-cp27m-win_amd64.whl (23.7 kB) Copy SHA256 Checksum SHA256 cp27 Wheel May 5, 2017
lazy_object_proxy-1.3.1-cp33-cp33m-manylinux1_i686.whl (49.9 kB) Copy SHA256 Checksum SHA256 cp33 Wheel May 5, 2017
lazy_object_proxy-1.3.1-cp33-cp33m-manylinux1_x86_64.whl (54.9 kB) Copy SHA256 Checksum SHA256 cp33 Wheel May 5, 2017
lazy_object_proxy-1.3.1-cp33-cp33m-win32.whl (22.0 kB) Copy SHA256 Checksum SHA256 cp33 Wheel May 5, 2017
lazy_object_proxy-1.3.1-cp33-cp33m-win_amd64.whl (23.5 kB) Copy SHA256 Checksum SHA256 cp33 Wheel May 5, 2017
lazy_object_proxy-1.3.1-cp34-cp34m-manylinux1_i686.whl (51.0 kB) Copy SHA256 Checksum SHA256 cp34 Wheel May 5, 2017
lazy_object_proxy-1.3.1-cp34-cp34m-manylinux1_x86_64.whl (55.8 kB) Copy SHA256 Checksum SHA256 cp34 Wheel May 5, 2017
lazy_object_proxy-1.3.1-cp34-cp34m-win32.whl (21.9 kB) Copy SHA256 Checksum SHA256 cp34 Wheel May 5, 2017
lazy_object_proxy-1.3.1-cp34-cp34m-win_amd64.whl (23.5 kB) Copy SHA256 Checksum SHA256 cp34 Wheel May 5, 2017
lazy_object_proxy-1.3.1-cp35-cp35m-manylinux1_i686.whl (51.2 kB) Copy SHA256 Checksum SHA256 cp35 Wheel May 5, 2017
lazy_object_proxy-1.3.1-cp35-cp35m-manylinux1_x86_64.whl (56.0 kB) Copy SHA256 Checksum SHA256 cp35 Wheel May 5, 2017
lazy_object_proxy-1.3.1-cp35-cp35m-win32.whl (23.3 kB) Copy SHA256 Checksum SHA256 cp35 Wheel May 5, 2017
lazy_object_proxy-1.3.1-cp35-cp35m-win_amd64.whl (25.6 kB) Copy SHA256 Checksum SHA256 cp35 Wheel May 5, 2017
lazy_object_proxy-1.3.1-cp36-cp36m-manylinux1_i686.whl (51.2 kB) Copy SHA256 Checksum SHA256 cp36 Wheel May 5, 2017
lazy_object_proxy-1.3.1-cp36-cp36m-manylinux1_x86_64.whl (56.0 kB) Copy SHA256 Checksum SHA256 cp36 Wheel May 5, 2017
lazy_object_proxy-1.3.1-cp36-cp36m-win32.whl (23.3 kB) Copy SHA256 Checksum SHA256 cp36 Wheel May 5, 2017
lazy_object_proxy-1.3.1-cp36-cp36m-win_amd64.whl (25.6 kB) Copy SHA256 Checksum SHA256 cp36 Wheel May 5, 2017
lazy-object-proxy-1.3.1.tar.gz (32.2 kB) Copy SHA256 Checksum SHA256 Source May 5, 2017

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting