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

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.1.tar.gz (32.2 kB view details)

Uploaded Source

Built Distributions

lazy_object_proxy-1.3.1-cp36-cp36m-win_amd64.whl (25.6 kB view details)

Uploaded CPython 3.6mWindows x86-64

lazy_object_proxy-1.3.1-cp36-cp36m-win32.whl (23.3 kB view details)

Uploaded CPython 3.6mWindows x86

lazy_object_proxy-1.3.1-cp36-cp36m-manylinux1_x86_64.whl (56.0 kB view details)

Uploaded CPython 3.6m

lazy_object_proxy-1.3.1-cp36-cp36m-manylinux1_i686.whl (51.2 kB view details)

Uploaded CPython 3.6m

lazy_object_proxy-1.3.1-cp35-cp35m-win_amd64.whl (25.6 kB view details)

Uploaded CPython 3.5mWindows x86-64

lazy_object_proxy-1.3.1-cp35-cp35m-win32.whl (23.3 kB view details)

Uploaded CPython 3.5mWindows x86

lazy_object_proxy-1.3.1-cp35-cp35m-manylinux1_x86_64.whl (56.0 kB view details)

Uploaded CPython 3.5m

lazy_object_proxy-1.3.1-cp35-cp35m-manylinux1_i686.whl (51.2 kB view details)

Uploaded CPython 3.5m

lazy_object_proxy-1.3.1-cp34-cp34m-win_amd64.whl (23.5 kB view details)

Uploaded CPython 3.4mWindows x86-64

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

Uploaded CPython 3.4mWindows x86

lazy_object_proxy-1.3.1-cp34-cp34m-manylinux1_x86_64.whl (55.8 kB view details)

Uploaded CPython 3.4m

lazy_object_proxy-1.3.1-cp34-cp34m-manylinux1_i686.whl (51.0 kB view details)

Uploaded CPython 3.4m

lazy_object_proxy-1.3.1-cp33-cp33m-win_amd64.whl (23.5 kB view details)

Uploaded CPython 3.3mWindows x86-64

lazy_object_proxy-1.3.1-cp33-cp33m-win32.whl (22.0 kB view details)

Uploaded CPython 3.3mWindows x86

lazy_object_proxy-1.3.1-cp33-cp33m-manylinux1_x86_64.whl (54.9 kB view details)

Uploaded CPython 3.3m

lazy_object_proxy-1.3.1-cp33-cp33m-manylinux1_i686.whl (49.9 kB view details)

Uploaded CPython 3.3m

lazy_object_proxy-1.3.1-cp27-cp27mu-manylinux1_x86_64.whl (56.5 kB view details)

Uploaded CPython 2.7mu

lazy_object_proxy-1.3.1-cp27-cp27mu-manylinux1_i686.whl (51.1 kB view details)

Uploaded CPython 2.7mu

lazy_object_proxy-1.3.1-cp27-cp27m-win_amd64.whl (23.7 kB view details)

Uploaded CPython 2.7mWindows x86-64

lazy_object_proxy-1.3.1-cp27-cp27m-win32.whl (22.2 kB view details)

Uploaded CPython 2.7mWindows x86

lazy_object_proxy-1.3.1-cp27-cp27m-manylinux1_x86_64.whl (56.5 kB view details)

Uploaded CPython 2.7m

lazy_object_proxy-1.3.1-cp27-cp27m-manylinux1_i686.whl (51.1 kB view details)

Uploaded CPython 2.7m

lazy_object_proxy-1.3.1-cp26-cp26mu-manylinux1_x86_64.whl (56.5 kB view details)

Uploaded CPython 2.6mu

lazy_object_proxy-1.3.1-cp26-cp26mu-manylinux1_i686.whl (51.1 kB view details)

Uploaded CPython 2.6mu

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

Uploaded CPython 2.6mWindows x86-64

lazy_object_proxy-1.3.1-cp26-cp26m-win32.whl (22.4 kB view details)

Uploaded CPython 2.6mWindows x86

lazy_object_proxy-1.3.1-cp26-cp26m-manylinux1_x86_64.whl (56.5 kB view details)

Uploaded CPython 2.6m

lazy_object_proxy-1.3.1-cp26-cp26m-manylinux1_i686.whl (51.1 kB view details)

Uploaded CPython 2.6m

File details

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

File metadata

File hashes

Hashes for lazy-object-proxy-1.3.1.tar.gz
Algorithm Hash digest
SHA256 eb91be369f945f10d3a49f5f9be8b3d0b93a4c2be8f8a5b83b0571b8123e0a7a
MD5 e128152b76eb5b9ba759504936139fd0
BLAKE2b-256 550823c0753599bdec1aec273e322f277c4e875150325f565017f6280549f554

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lazy_object_proxy-1.3.1-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 27bf62cb2b1a2068d443ff7097ee33393f8483b570b475db8ebf7e1cba64f088
MD5 472c718413901c01380f4d5d9fcad00a
BLAKE2b-256 7c71e7a10cab32c9fc37467e2f211a46328784a07bc5d7a977b1fe6b01a5f1a1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lazy_object_proxy-1.3.1-cp36-cp36m-win32.whl
Algorithm Hash digest
SHA256 50e3b9a464d5d08cc5227413db0d1c4707b6172e4d4d915c1c70e4de0bbff1f5
MD5 aa52f80450192452a98aa1249419d429
BLAKE2b-256 84dcc9b2981ae5b93d4903bb3a13d4dacada971057e800831ef59033eb14db43

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lazy_object_proxy-1.3.1-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 e34b155e36fa9da7e1b7c738ed7767fc9491a62ec6af70fe9da4a057759edc2d
MD5 a4461a2a1d021f03fc469e2d35995d06
BLAKE2b-256 651f2043ec33066e779905ed7e6580384425fdc7dc2ac64d6931060c75b0c5a3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lazy_object_proxy-1.3.1-cp36-cp36m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 0ce34342b419bd8f018e6666bfef729aec3edf62345a53b537a4dcc115746a33
MD5 7654427fea88de1cb30c470b7d84a659
BLAKE2b-256 bdf25459659c73f286ad368b7e1c4616bd0cb3cbe59201a920116476184da1c4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lazy_object_proxy-1.3.1-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 7cb54db3535c8686ea12e9535eb087d32421184eacc6939ef15ef50f83a5e7e2
MD5 a18d697611d8254b6ab408aad3e25a4c
BLAKE2b-256 dd35269522f9e38030c204a54500d44d5e1bbcda00fa2946c648e4b423d0f30a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lazy_object_proxy-1.3.1-cp35-cp35m-win32.whl
Algorithm Hash digest
SHA256 ab3ca49afcb47058393b0122428358d2fbe0408cf99f1b58b295cfeb4ed39109
MD5 c36e881db1e015aa4d94ae0e92cf86b0
BLAKE2b-256 54446864224f03333712ff12b42fce0219865725123b2c41b87f4b71eaaa2fd5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lazy_object_proxy-1.3.1-cp35-cp35m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 7bd527f36a605c914efca5d3d014170b2cb184723e423d26b1fb2fd9108e264d
MD5 ec127b98cb675929b3e3e9432c2bc759
BLAKE2b-256 1088d7b8274edf912be71d73a1e5de7988f62b63d9e88e591da2e6f921ab69e6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lazy_object_proxy-1.3.1-cp35-cp35m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 ddc34786490a6e4ec0a855d401034cbd1242ef186c20d79d2166d6a4bd449577
MD5 38e356e67b403c5b11fdc5ea84686765
BLAKE2b-256 9e20dbf407fbbf1863e61f6571a23117fcebc0a5cd13d13351f4002b40f6b755

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lazy_object_proxy-1.3.1-cp34-cp34m-win_amd64.whl
Algorithm Hash digest
SHA256 81304b7d8e9c824d058087dcb89144842c8e0dea6d281c031f59f0acf66963d4
MD5 b74920cb6a6c45b98c33716c4c8c3656
BLAKE2b-256 61532d10be848758b4261dd97bc70e7e7f76731bfaa996328e78f60ff9dc364b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lazy_object_proxy-1.3.1-cp34-cp34m-win32.whl
Algorithm Hash digest
SHA256 e81ebf6c5ee9684be8f2c87563880f93eedd56dd2b6146d8a725b50b7e5adb0f
MD5 a195c6ef76cc97e6212e0ad3b50a44be
BLAKE2b-256 9f62efac62e435304e46e90158330fe6defae3babfeef713cf7849e00842ee7f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lazy_object_proxy-1.3.1-cp34-cp34m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 f460d1ceb0e4a5dcb2a652db0904224f367c9b3c1470d5a7683c0480e582468b
MD5 6cc2517a62a597e94dac204a298332b0
BLAKE2b-256 fd80825b2c8d828a8fcae14f6e6c19eeefda649462e9e95894a184b53913e79e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lazy_object_proxy-1.3.1-cp34-cp34m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 6ae6c4cb59f199d8827c5a07546b2ab7e85d262acaccaacd49b62f53f7c456f7
MD5 8790dc19577dddca3d995f6ea9c51f6a
BLAKE2b-256 84d4b5b8c2092468728f44744201b34c33f4c9f67fed4fc9399855ed170fcd3d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lazy_object_proxy-1.3.1-cp33-cp33m-win_amd64.whl
Algorithm Hash digest
SHA256 94223d7f060301b3a8c09c9b3bc3294b56b2188e7d8179c762a1cda72c979252
MD5 81e0f06a2f94581aee3e71046ea90c40
BLAKE2b-256 70aef7321d66f1c46e9a7db7894254dfbaf8280d6a988f828662b3ff32f950a5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lazy_object_proxy-1.3.1-cp33-cp33m-win32.whl
Algorithm Hash digest
SHA256 5276db7ff62bb7b52f77f1f51ed58850e315154249aceb42e7f4c611f0f847ff
MD5 5bc02a1cc699104bab16ad351a5da2e3
BLAKE2b-256 8276a75a5fa072b2a499464ef15d508c662e20c1bd3ccedc3795c07ec64bbde1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lazy_object_proxy-1.3.1-cp33-cp33m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 7f3a2d740291f7f2c111d86a1c4851b70fb000a6c8883a59660d95ad57b9df35
MD5 dc139bc3c6c96948b49a4a241ccb6ac7
BLAKE2b-256 3df95d0ef1e25c55b631221a24292cfcaf56813b36776962b67d54db815a1fe0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lazy_object_proxy-1.3.1-cp33-cp33m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 d0fc7a286feac9077ec52a927fc9fe8fe2fabab95426722be4c953c9a8bede92
MD5 db5696f9662a1e912272bfd7f01e0752
BLAKE2b-256 6ad7a4f33b5e45e75a044ed54cf26b5aa248acfd5c9b0e7a53dfed68e6984ca3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lazy_object_proxy-1.3.1-cp27-cp27mu-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 61a6cf00dcb1a7f0c773ed4acc509cb636af2d6337a08f362413c76b2b47a8dd
MD5 d542f9ce9cb13ecd02a20bf42a628089
BLAKE2b-256 527ef0f570ba363e15251bb9fd452257ec2aff91be0187a08a893afbd8ae225f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lazy_object_proxy-1.3.1-cp27-cp27mu-manylinux1_i686.whl
Algorithm Hash digest
SHA256 7661d401d60d8bf15bb5da39e4dd72f5d764c5aff5a86ef52a042506e3e970ff
MD5 b1827ffb50eed29d7d2062cb54516584
BLAKE2b-256 19d620da1ea7ab2c2ca4b55c8f8c6ca5d5e12803781c0405abf3121fb1d79178

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lazy_object_proxy-1.3.1-cp27-cp27m-win_amd64.whl
Algorithm Hash digest
SHA256 933947e8b4fbe617a51528b09851685138b49d511af0b6c0da2539115d6d4514
MD5 7eaaa0bf54bb08214ce826c781fa16a1
BLAKE2b-256 58932bf9b50faf4941b7ff8851f3c81820a88e505b01da4cd95d1d3d818e738f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lazy_object_proxy-1.3.1-cp27-cp27m-win32.whl
Algorithm Hash digest
SHA256 bd6292f565ca46dee4e737ebcc20742e3b5be2b01556dafe169f6c65d088875f
MD5 06d38f72b1684ced95c1c805fe76fb2d
BLAKE2b-256 5987bce6f8cfd8d0c2fe309bd9f6f78fdd74b7cfd73f27297202862b619d803d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lazy_object_proxy-1.3.1-cp27-cp27m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 e5b9e8f6bda48460b7b143c3821b21b452cb3a835e6bbd5dd33aa0c8d3f5137d
MD5 bfbfaaee93743f1472bf8c2050b16601
BLAKE2b-256 8a1b7b6559adb8c25aea979f1aafe4d4b294b5278fc81e88c0080cc7b9d1a517

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lazy_object_proxy-1.3.1-cp27-cp27m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 27ea6fd1c02dcc78172a82fc37fcc0992a94e4cecf53cb6d73f11749825bd98b
MD5 95b114c9d838ff0bb032121ce34110e0
BLAKE2b-256 7f054e3ae365e7ed390c382fac944cfa9fa3a6b792dffd5c41736e54b11ca89b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lazy_object_proxy-1.3.1-cp26-cp26mu-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 2c1b21b44ac9beb0fc848d3993924147ba45c4ebc24be19825e57aabbe74a99e
MD5 b413b4a0bc9aac2be1e7c848255c76fb
BLAKE2b-256 8d0800aab975c99d156aec2d47e9e7a947ac3af3efab5065f666c8b157acc7a8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lazy_object_proxy-1.3.1-cp26-cp26mu-manylinux1_i686.whl
Algorithm Hash digest
SHA256 cb924aa3e4a3fb644d0c463cad5bc2572649a6a3f68a7f8e4fbe44aaa6d77e4c
MD5 a6171fd780be9afcd426f243294fa9cb
BLAKE2b-256 aefaaf42c87071129cfbaffdd27962599f00a9ba1e0ee1c96709de032b5d457c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lazy_object_proxy-1.3.1-cp26-cp26m-win_amd64.whl
Algorithm Hash digest
SHA256 2df72ab12046a3496a92476020a1a0abf78b2a7db9ff4dc2036b8dd980203ae6
MD5 f01c08363f8be838874a8ae1852df3b5
BLAKE2b-256 548fa2edc0202ed32e2afaedd8248f58ed046a8b50fc4ab27e6a4939a1efeabd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lazy_object_proxy-1.3.1-cp26-cp26m-win32.whl
Algorithm Hash digest
SHA256 320ffd3de9699d3892048baee45ebfbbf9388a7d65d832d7e580243ade426d2b
MD5 d13b11809baa285bec7aebe0186be571
BLAKE2b-256 2ffd1830834d47c840ceaba28eaffb7c6b22e96f7c401509d3f4537e345f140e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lazy_object_proxy-1.3.1-cp26-cp26m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 1b668120716eb7ee21d8a38815e5eb3bb8211117d9a90b0f8e21722c0758cc39
MD5 4e0dcc91606e18f258188f3e8a740d12
BLAKE2b-256 cddecb74dc6d652e1eaaeea27a67332eeb42e4b2fb842e31aeeed62055db53c8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lazy_object_proxy-1.3.1-cp26-cp26m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 209615b0fe4624d79e50220ce3310ca1a9445fd8e6d3572a896e7f9146bbf019
MD5 d3e1f4141acc4b098dcff611746754ff
BLAKE2b-256 8270f8b046861cd27287ce0cb4a624f2efb6c47a890a06569c32d4d824db3a9c

See more details on using hashes here.

Supported by

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