Skip to main content

compute function default value for each call

Project description

Return a function whose default values will be computed for each call,
instead of evaluating the default values when function definition is executed.

make sure this function is the last(closest to the function) decorator
Usage:
@default_value_for_each_call.compute_default_value_for_each_call
def foo(a=([])):
a.append(3)
print a

foo()
foo()

Output:
[3]
[3]

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

default_value_for_each_call-0.6.tar.gz (1.7 kB view hashes)

Uploaded Source

Supported by

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