In [7]: def r():
...: return random.randint(1,100)
...:
In [12]: def d(a, b=r()):
....: print b,'-------------'
....:
In [13]: d(9)
75 -------------
In [14]: d(9)
75 -------------
默认参数只在函数定义时被计算出值
In [18]: d.func_defaults
Out[18]: (75,)