Skip to main content
Python Software Foundation 20th Year Anniversary Fundraiser  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:

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:
elif temp2:

Somebody need to hold that result for you:

h = Holder()
if h(do_something()) == 42:
elif h(do_something_else()):

Project details

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page