消息 [235154]
.signature also handles wrapped functions better.
>>> def deco(f):
import functools
@functools.wraps(f)
def ret(*args, **kw):
return f(*args, **kw)
return ret
>>> @deco
def f(n, k):
return n + k*2
>>> import inspect as ip
>>> isf=ip.signature(f)
>>> print(isf)
(n, k)
>>> ip.formatargspec(*ip.getfullargspec(f))
'(*args, **kw)' |
|
| 日期 |
用户 |
动作 |
参数 |
| 2015-02-01 09:30:15 | terry.reedy | 修改 | recipients:
+ terry.reedy, yselivanov |
| 2015-02-01 09:30:15 | terry.reedy | 修改 | messageid: <1422783015.85.0.276072480946.issue19903@psf.upfronthosting.co.za> |
| 2015-02-01 09:30:15 | terry.reedy | 链接 | issue19903 messages |
| 2015-02-01 09:30:15 | terry.reedy | 创建 | |
|