Message158864
| Author |
r.david.murray |
| Recipients |
michael.foord, r.david.murray |
| Date |
2012年04月20日.18:08:03 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1334945284.24.0.289841146723.issue14634@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
The following code:
def foo(a, *, b=None):
pass
unittest.mock.create_autospec(foo)
fails with this traceback:
Traceback (most recent call last):
File "temp.py", line 6, in <module>
unittest.mock.create_autospec(foo)
File "/home/rdmurray/python/p33/Lib/unittest/mock.py", line 2026, in create_autospec
mock = _set_signature(mock, spec)
File "/home/rdmurray/python/p33/Lib/unittest/mock.py", line 162, in _set_signature
result = _getsignature(original, skipfirst, instance)
File "/home/rdmurray/python/p33/Lib/unittest/mock.py", line 81, in _getsignature
regargs, varargs, varkwargs, defaults = inspect.getargspec(func)
File "/home/rdmurray/python/p33/Lib/inspect.py", line 808, in getargspec
raise ValueError("Function has keyword-only arguments or annotations"
ValueError: Function has keyword-only arguments or annotations, use getfullargspec() API which can support them |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2012年04月20日 18:08:04 | r.david.murray | set | recipients:
+ r.david.murray, michael.foord |
| 2012年04月20日 18:08:04 | r.david.murray | set | messageid: <1334945284.24.0.289841146723.issue14634@psf.upfronthosting.co.za> |
| 2012年04月20日 18:08:03 | r.david.murray | link | issue14634 messages |
| 2012年04月20日 18:08:03 | r.david.murray | create |
|