-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
32 lines (27 loc) · 863 Bytes
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/usr/bin/env python
# coding=utf-8
__author__ = 'chenfengyuan'
from setuptools import setup
setup(
name="default_value_for_each_call",
version="0.6",
author="Chen Fengyuan",
author_email="[email protected]",
description="compute function default value for each call",
license="BSD",
keywords="example documentation tutorial",
py_modules=['default_value_for_each_call'],
long_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]"""
)