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!

Caches a result, and returns it. Useful in if statements.

Project Description
In python it is not possible to do this:
::
if temp=do_something() == 42:
foo(temp)
::

And storing it before is not an option?
(you have something very resources-expensive, or changing values)

::
temp = do_something()
temp2 = do_something_else()
if temp == 42:
foo(temp)
elif temp2:
foo2(temp2)
::

Somebody need to hold that result for you:

::
h = Holder()
if h(do_something()) == 42:
foo(h())
elif h(do_something_else()):
foo2(h())
Release History

Release History

This version
History Node

0.0.0

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