skip to navigation
skip to content

Not Logged In

default_value_for_each_call 0.6

compute function default value for each call

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]  
File Type Py Version Uploaded on Size
default_value_for_each_call-0.6.tar.gz (md5) Source 2014-07-28 1KB
  • Downloads (All Versions):
  • 6 downloads in the last day
  • 82 downloads in the last week
  • 395 downloads in the last month