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.

Filename, size & hash SHA256 hash help File type Python version Upload date
default_value_for_each_call-0.6.tar.gz (1.7 kB) Copy SHA256 hash SHA256 Source None Jul 28, 2014

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page