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 details)

Uploaded Source

File details

Details for the file default_value_for_each_call-0.6.tar.gz.

File metadata

File hashes

Hashes for default_value_for_each_call-0.6.tar.gz
Algorithm Hash digest
SHA256 52da690dd95a39161f740c8d300b432a4e574d6af5d2d0f6647b78821fa3d9d2
MD5 da9c3ffb414aa7317f5e338cfb656f48
BLAKE2b-256 38f41b8697c448cc4036030ece46868a3afcd4739926c948547a054b74bf2bce

See more details on using hashes here.

Supported by

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