Skip to main content

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

Documentation

https://python-lazy-object-proxy.readthedocs.io/

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.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.

Project details


Download files

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

Source Distribution

lazy-object-proxy-1.3.0.tar.gz (32.2 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

lazy_object_proxy-1.3.0-cp36-cp36m-win_amd64.whl (25.5 kB view details)

Uploaded CPython 3.6mWindows x86-64

lazy_object_proxy-1.3.0-cp36-cp36m-win32.whl (23.2 kB view details)

Uploaded CPython 3.6mWindows x86

lazy_object_proxy-1.3.0-cp36-cp36m-manylinux1_x86_64.whl (55.9 kB view details)

Uploaded CPython 3.6m

lazy_object_proxy-1.3.0-cp36-cp36m-manylinux1_i686.whl (51.1 kB view details)

Uploaded CPython 3.6m

lazy_object_proxy-1.3.0-cp35-cp35m-win_amd64.whl (25.5 kB view details)

Uploaded CPython 3.5mWindows x86-64

lazy_object_proxy-1.3.0-cp35-cp35m-win32.whl (23.2 kB view details)

Uploaded CPython 3.5mWindows x86

lazy_object_proxy-1.3.0-cp35-cp35m-manylinux1_x86_64.whl (55.9 kB view details)

Uploaded CPython 3.5m

lazy_object_proxy-1.3.0-cp35-cp35m-manylinux1_i686.whl (51.1 kB view details)

Uploaded CPython 3.5m

lazy_object_proxy-1.3.0-cp34-cp34m-win_amd64.whl (23.4 kB view details)

Uploaded CPython 3.4mWindows x86-64

lazy_object_proxy-1.3.0-cp34-cp34m-win32.whl (21.9 kB view details)

Uploaded CPython 3.4mWindows x86

lazy_object_proxy-1.3.0-cp34-cp34m-manylinux1_x86_64.whl (55.7 kB view details)

Uploaded CPython 3.4m

lazy_object_proxy-1.3.0-cp34-cp34m-manylinux1_i686.whl (50.9 kB view details)

Uploaded CPython 3.4m

lazy_object_proxy-1.3.0-cp33-cp33m-win_amd64.whl (23.4 kB view details)

Uploaded CPython 3.3mWindows x86-64

lazy_object_proxy-1.3.0-cp33-cp33m-win32.whl (21.9 kB view details)

Uploaded CPython 3.3mWindows x86

lazy_object_proxy-1.3.0-cp33-cp33m-manylinux1_x86_64.whl (54.8 kB view details)

Uploaded CPython 3.3m

lazy_object_proxy-1.3.0-cp33-cp33m-manylinux1_i686.whl (49.8 kB view details)

Uploaded CPython 3.3m

lazy_object_proxy-1.3.0-cp27-cp27mu-manylinux1_x86_64.whl (56.4 kB view details)

Uploaded CPython 2.7mu

lazy_object_proxy-1.3.0-cp27-cp27mu-manylinux1_i686.whl (51.0 kB view details)

Uploaded CPython 2.7mu

lazy_object_proxy-1.3.0-cp27-cp27m-win_amd64.whl (23.6 kB view details)

Uploaded CPython 2.7mWindows x86-64

lazy_object_proxy-1.3.0-cp27-cp27m-win32.whl (22.1 kB view details)

Uploaded CPython 2.7mWindows x86

lazy_object_proxy-1.3.0-cp27-cp27m-manylinux1_x86_64.whl (56.4 kB view details)

Uploaded CPython 2.7m

lazy_object_proxy-1.3.0-cp27-cp27m-manylinux1_i686.whl (51.0 kB view details)

Uploaded CPython 2.7m

lazy_object_proxy-1.3.0-cp26-cp26mu-manylinux1_x86_64.whl (56.4 kB view details)

Uploaded CPython 2.6mu

lazy_object_proxy-1.3.0-cp26-cp26mu-manylinux1_i686.whl (51.0 kB view details)

Uploaded CPython 2.6mu

lazy_object_proxy-1.3.0-cp26-cp26m-win_amd64.whl (23.9 kB view details)

Uploaded CPython 2.6mWindows x86-64

lazy_object_proxy-1.3.0-cp26-cp26m-win32.whl (22.3 kB view details)

Uploaded CPython 2.6mWindows x86

lazy_object_proxy-1.3.0-cp26-cp26m-manylinux1_x86_64.whl (56.4 kB view details)

Uploaded CPython 2.6m

lazy_object_proxy-1.3.0-cp26-cp26m-manylinux1_i686.whl (51.0 kB view details)

Uploaded CPython 2.6m

File details

Details for the file lazy-object-proxy-1.3.0.tar.gz.

File metadata

File hashes

Hashes for lazy-object-proxy-1.3.0.tar.gz
Algorithm Hash digest
SHA256 bf4778a8d0efef27d8080718ac6efb437c520d697d61e6935787e56fc0bab2c8
MD5 c6bbda7b3aba0e46bc3af0679d5938fd
BLAKE2b-256 d334e5e1988eb17ab4169927fc7a33c67215a30498dadd513631299cae546ddb

See more details on using hashes here.

File details

Details for the file lazy_object_proxy-1.3.0-cp36-cp36m-win_amd64.whl.

File metadata

File hashes

Hashes for lazy_object_proxy-1.3.0-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 7e931f77dfbe71f0a8d78de89c0e0de2ecd376aedb603ea1ce7358838de857b5
MD5 95469f236a2489fedd1663450dd382e1
BLAKE2b-256 ade6dd0934c7c69d4ab2ac0b3b8f83f30bda6d604cb6cf3cba650867fe166353

See more details on using hashes here.

File details

Details for the file lazy_object_proxy-1.3.0-cp36-cp36m-win32.whl.

File metadata

File hashes

Hashes for lazy_object_proxy-1.3.0-cp36-cp36m-win32.whl
Algorithm Hash digest
SHA256 89b23bd497183f7170d8e1f4282935258cf942a182d136ffbf1d630262376ffd
MD5 c6c8da7fd3250e4496628f7b32f0a2bb
BLAKE2b-256 47672f009b3b6ea6dc1349bf88e3f174bb38b4ccc9d3ca83167156bdebaf6be7

See more details on using hashes here.

File details

Details for the file lazy_object_proxy-1.3.0-cp36-cp36m-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for lazy_object_proxy-1.3.0-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 4299d7a67c32391d0207c47f7e6ea15cab9ad9a82417684ee38d0939c88aba02
MD5 bd7ac657a856ff17833cd88dd1170dee
BLAKE2b-256 9545d4823a979ef73270e727a91a08b346be94c6726077a2fc7ca0ec3ce9cefa

See more details on using hashes here.

File details

Details for the file lazy_object_proxy-1.3.0-cp36-cp36m-manylinux1_i686.whl.

File metadata

File hashes

Hashes for lazy_object_proxy-1.3.0-cp36-cp36m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 d4e090ac3cf920551092ba288cfd63858ae239ddfc7b9b57d64bf9bb9e2562e1
MD5 18d4dea9b49a30546202bd1bb5360125
BLAKE2b-256 1aa7fb64b6d60ec7582cb19d915d64c0fe88b80a2290ecfe0c3da2b2557b012d

See more details on using hashes here.

File details

Details for the file lazy_object_proxy-1.3.0-cp35-cp35m-win_amd64.whl.

File metadata

File hashes

Hashes for lazy_object_proxy-1.3.0-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 e9b3f3eafbd7eb2facc991e536a4f93ed05a0afadc2658839d1268d850aeadce
MD5 ee924bbb2ee5722aa18b9c75dbdaeae8
BLAKE2b-256 a3a01530f50d45b138fa9627c69a87c5227bd9847f622ade1b401c4daa16ee80

See more details on using hashes here.

File details

Details for the file lazy_object_proxy-1.3.0-cp35-cp35m-win32.whl.

File metadata

File hashes

Hashes for lazy_object_proxy-1.3.0-cp35-cp35m-win32.whl
Algorithm Hash digest
SHA256 1c5dc98a62bdf12ad281cc815f9499a15a8a2e7176be3c790a8c00fe34dc2353
MD5 60473975576e835bd1e571eb74d9d9f4
BLAKE2b-256 5acd7cd32a67b98d893bdcae6fef4a7a263c0e60875a1bd8061c116e274361ba

See more details on using hashes here.

File details

Details for the file lazy_object_proxy-1.3.0-cp35-cp35m-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for lazy_object_proxy-1.3.0-cp35-cp35m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 90187f5873a1fecc081e351f6e5faf165bfc717d127733282061a8ae40ade077
MD5 4f1908a378676c9efafe6aab41b40838
BLAKE2b-256 e24f1340c16796d13448c958856368336670bdb634d0bdc1602aa605dde49c48

See more details on using hashes here.

File details

Details for the file lazy_object_proxy-1.3.0-cp35-cp35m-manylinux1_i686.whl.

File metadata

File hashes

Hashes for lazy_object_proxy-1.3.0-cp35-cp35m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 196aee196a634c2b10a232adf263de717790acc105ad31982645fcf990ab35ad
MD5 6b6dfa37578b301d40ebf61e8856cc9b
BLAKE2b-256 3d063e17befc0034b101d34948b2a16f0658eb515331811a12e50aa02327f123

See more details on using hashes here.

File details

Details for the file lazy_object_proxy-1.3.0-cp34-cp34m-win_amd64.whl.

File metadata

File hashes

Hashes for lazy_object_proxy-1.3.0-cp34-cp34m-win_amd64.whl
Algorithm Hash digest
SHA256 cd39efe9333475e47f2908dea68c06326810525b670abb26f70d5408a9d7356b
MD5 6c2db4fa11062cc43697b642bc36b1ee
BLAKE2b-256 c4f09a920e715a5aad399c4440bae23d9891bb6cfa6249aec88436f5cbf5688f

See more details on using hashes here.

File details

Details for the file lazy_object_proxy-1.3.0-cp34-cp34m-win32.whl.

File metadata

File hashes

Hashes for lazy_object_proxy-1.3.0-cp34-cp34m-win32.whl
Algorithm Hash digest
SHA256 182c855c9a1b2eeac9bc054a719d36ac1e71841fcae2332f29ca2084678deda1
MD5 b72077d2826b5816caf532eb2dfcadf9
BLAKE2b-256 2b504dccbfeca83500e945941641f2e83f63d7123bee0aa2ae5a153ab87280a0

See more details on using hashes here.

File details

Details for the file lazy_object_proxy-1.3.0-cp34-cp34m-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for lazy_object_proxy-1.3.0-cp34-cp34m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 148632878a6d305fce2c83fa3b34a4292ce5c0b790e3cd773d225d1b412fe646
MD5 7a6c6922e95e97970fa36d17181b2be0
BLAKE2b-256 49dc33e86a2aad191543d1910c1b7e69d1681fbc634a5abdfc2ccbe8e9bae0fa

See more details on using hashes here.

File details

Details for the file lazy_object_proxy-1.3.0-cp34-cp34m-manylinux1_i686.whl.

File metadata

File hashes

Hashes for lazy_object_proxy-1.3.0-cp34-cp34m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 ae1b8d98c0db8ff5d5b03bf553b9601204d7670a3fa89b0d4ad8d785664ede76
MD5 8b2164fe8149799dd47c26cf91c683de
BLAKE2b-256 1d08b7d5188255bce70d19358dc6aeb4e6a8304c3a7f029bd64aaa591303ba90

See more details on using hashes here.

File details

Details for the file lazy_object_proxy-1.3.0-cp33-cp33m-win_amd64.whl.

File metadata

File hashes

Hashes for lazy_object_proxy-1.3.0-cp33-cp33m-win_amd64.whl
Algorithm Hash digest
SHA256 57cf975d79a4aa3f7d41c861386e93bc18f7c3b9af19642168455fb901828520
MD5 d2584ed58b5043a02236aa991d7cef4d
BLAKE2b-256 368187796e66c5fbb5a8598429ea84f0d553c68ca7c5bf93890831d221ef7c19

See more details on using hashes here.

File details

Details for the file lazy_object_proxy-1.3.0-cp33-cp33m-win32.whl.

File metadata

File hashes

Hashes for lazy_object_proxy-1.3.0-cp33-cp33m-win32.whl
Algorithm Hash digest
SHA256 84e92d5ff0c0c951cf247aeeb9043b2e8211d58996f64c35c8f3b0193893b9af
MD5 581d2d2ff8749eabfa8f3eaa6fc6e9bb
BLAKE2b-256 b584aed4c5eed1d80dcf18721bb1a17fd50bef06b420f95923f3704d46e2ac33

See more details on using hashes here.

File details

Details for the file lazy_object_proxy-1.3.0-cp33-cp33m-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for lazy_object_proxy-1.3.0-cp33-cp33m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 32ac7f3b0f01da1da3f8d9ccc3c25073366ce496fb5a5cc3b2a69b543612cb23
MD5 5875c69c52cffcbf21cc704cbab53ddc
BLAKE2b-256 f8e7ab7d1170d217d22cf8fc75192c924e65314efe26bbd0329c313542050253

See more details on using hashes here.

File details

Details for the file lazy_object_proxy-1.3.0-cp33-cp33m-manylinux1_i686.whl.

File metadata

File hashes

Hashes for lazy_object_proxy-1.3.0-cp33-cp33m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 baf882db21a817f5e2546b2129cc2e16bb8051dd4525c0169a6e43f2e296068c
MD5 3c4ba94ed19b6e50c0457222735d9609
BLAKE2b-256 e5ef09c62149efa82d5deced202fdc0997d33a6db839628ebf5836198c54b31f

See more details on using hashes here.

File details

Details for the file lazy_object_proxy-1.3.0-cp27-cp27mu-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for lazy_object_proxy-1.3.0-cp27-cp27mu-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 1fc6dd8bbdbc6172e086c4657669b8a092b67b80e87acd1d546bf70b10adabc9
MD5 34d151b895e4a71d9148b9d31945013f
BLAKE2b-256 c90fe6fba9cf7dbfbe6febb645708045b7a34f7b9579334be075027d58b6506f

See more details on using hashes here.

File details

Details for the file lazy_object_proxy-1.3.0-cp27-cp27mu-manylinux1_i686.whl.

File metadata

File hashes

Hashes for lazy_object_proxy-1.3.0-cp27-cp27mu-manylinux1_i686.whl
Algorithm Hash digest
SHA256 f2a325fb5235f936bba2f0d108fff6e3b07cf83cbc55337f96990b3b281e3946
MD5 695c5ca9dd616cbfd12e230df5985718
BLAKE2b-256 c41c8c970117e6da38433c8f24500923dcc149096991f64eb82d3112f5e57513

See more details on using hashes here.

File details

Details for the file lazy_object_proxy-1.3.0-cp27-cp27m-win_amd64.whl.

File metadata

File hashes

Hashes for lazy_object_proxy-1.3.0-cp27-cp27m-win_amd64.whl
Algorithm Hash digest
SHA256 7c3095db495b06b3e8bd94ccb6e848f3c1ba799256652c05f6b2292528b9d9f1
MD5 78a62e08e414f2edac8f276d3fb7b1ea
BLAKE2b-256 b3a8a4f8fadd0b36b8d4f3200ddc2044e79d63401960fcd35aad54640fad3d5b

See more details on using hashes here.

File details

Details for the file lazy_object_proxy-1.3.0-cp27-cp27m-win32.whl.

File metadata

File hashes

Hashes for lazy_object_proxy-1.3.0-cp27-cp27m-win32.whl
Algorithm Hash digest
SHA256 50ca7f33cc5e35bea7653f46513598680d2e373db4c80c75f11aa359b48d5079
MD5 d0c653dc08a0b31311caa313036c2b3c
BLAKE2b-256 add4dbb79d77cfe0d7e52a09e0f1ea86ed73b05ad69045bfd3c091aa6fe32bb0

See more details on using hashes here.

File details

Details for the file lazy_object_proxy-1.3.0-cp27-cp27m-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for lazy_object_proxy-1.3.0-cp27-cp27m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 8cb3137ee9e27d2ed504e78f3fbf96cb8391cc3b987d2e522a00a55ba4e280b7
MD5 f3238c6e9eee80a0e2acef90c2789cad
BLAKE2b-256 4a01f3a9cc12de90faf601affa88514694549471d29cbea89004c1087941aba5

See more details on using hashes here.

File details

Details for the file lazy_object_proxy-1.3.0-cp27-cp27m-manylinux1_i686.whl.

File metadata

File hashes

Hashes for lazy_object_proxy-1.3.0-cp27-cp27m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 22fd4a3023c25b1d28242170e4fd3a844560649793e2f5ac9ea3bc39b437ff43
MD5 55f8e6ff1350ac0c869c42b19622dd2f
BLAKE2b-256 1018a076ae041d491993cab877df5b01edf0a962117633a4aa2535d29bcdbfad

See more details on using hashes here.

File details

Details for the file lazy_object_proxy-1.3.0-cp26-cp26mu-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for lazy_object_proxy-1.3.0-cp26-cp26mu-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 6e2e64225bc854430567275040a8dc09d3335ec8b5c86b4af223d8dc66b70fde
MD5 f30632a078243ad7ff2e210b910a4a28
BLAKE2b-256 61c52594dfe8891dd814295b5e9e7b7172be487772dd37ff1a7244a858a30db6

See more details on using hashes here.

File details

Details for the file lazy_object_proxy-1.3.0-cp26-cp26mu-manylinux1_i686.whl.

File metadata

File hashes

Hashes for lazy_object_proxy-1.3.0-cp26-cp26mu-manylinux1_i686.whl
Algorithm Hash digest
SHA256 624c339791fb1a01bdbcf263907ffa0d20bfaadaa2af757ee38f049618e7753c
MD5 2cfb3c9c75f731d840380fbf4c2712ca
BLAKE2b-256 e1760d9867e110b0c5bcb3ce9e383ffdef3e41fddb800c7209955102d8ab628f

See more details on using hashes here.

File details

Details for the file lazy_object_proxy-1.3.0-cp26-cp26m-win_amd64.whl.

File metadata

File hashes

Hashes for lazy_object_proxy-1.3.0-cp26-cp26m-win_amd64.whl
Algorithm Hash digest
SHA256 ae7f35d1f5fa3d3e9cd1ee63f35b55d9d518bd6dde250e849d9ef498099a104b
MD5 131c29ec4a2cf872f75b0ec9069a5a70
BLAKE2b-256 ed91c0709530065c88ed8bdf7d38698df57e06512e3fa2eddc0fe5dab4402932

See more details on using hashes here.

File details

Details for the file lazy_object_proxy-1.3.0-cp26-cp26m-win32.whl.

File metadata

File hashes

Hashes for lazy_object_proxy-1.3.0-cp26-cp26m-win32.whl
Algorithm Hash digest
SHA256 27ce7bcafc964df1d3a7379483dafafc0a4f8130820f4e6a23608f7fa7bf7d71
MD5 8aa728bf120a2bf6a74e9c8a4469d462
BLAKE2b-256 3c784fadbfa2c3e11ef14ddb80d820058f4c122ea0fa67737029ec2161884a7c

See more details on using hashes here.

File details

Details for the file lazy_object_proxy-1.3.0-cp26-cp26m-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for lazy_object_proxy-1.3.0-cp26-cp26m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 e3203729b396ca91965a3a8a38ccf3c9ec5e9f220c18aa6eeeced41da76f171f
MD5 2ce19d98587bfcbcf294239c9e6916b1
BLAKE2b-256 ee44b54ba5b0d6959af61738814b957ec0fe2913dfb07e1d231aed88ca27ba0a

See more details on using hashes here.

File details

Details for the file lazy_object_proxy-1.3.0-cp26-cp26m-manylinux1_i686.whl.

File metadata

File hashes

Hashes for lazy_object_proxy-1.3.0-cp26-cp26m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 9b5231847adc65f7f68f3bef4677034ed2828f46f57ef388e391b9c09118f2f3
MD5 67165b9a75e1fdcfaccc0f89940b558f
BLAKE2b-256 a13b011da3291bfad7b20331707a0130c1d476c1832193878111992ca776d803

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page