Title: inspect.signature(math.log) raises ValueError
Type: behavior Stage: resolved
Components: Argument Clinic Versions: Python 3.8, Python 3.7
Status: closed Resolution: duplicate
Dependencies: Superseder: Argument Clinic: Fix signature of optional positional-only arguments
View: 29299
Assigned To: Nosy List: SilentGhost, larry, remi.lapeyre
Priority: normal Keywords:

Created on 2019-03-15 16:44 by remi.lapeyre, last changed 2019-03-15 17:24 by SilentGhost. This issue is now closed.

Messages (4)
msg338002 - (view) Author: Rémi Lapeyre (remi.lapeyre) * Date: 2019-03-15 16:44
>>> import math, inspect
>>> inspect.signature(math.log)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/remi/src/cpython/Lib/", line 3081, in signature
    return Signature.from_callable(obj, follow_wrapped=follow_wrapped)
  File "/Users/remi/src/cpython/Lib/", line 2830, in from_callable
    return _signature_from_callable(obj, sigcls=cls,
  File "/Users/remi/src/cpython/Lib/", line 2284, in _signature_from_callable
    return _signature_from_builtin(sigcls, obj,
  File "/Users/remi/src/cpython/Lib/", line 2109, in _signature_from_builtin
    raise ValueError("no signature found for builtin {!r}".format(func))
ValueError: no signature found for builtin <built-in function log>

This is the only function from math to do so, it may be related to issue    29299 but the patch from Victor Stinner does not fix this.
msg338008 - (view) Author: SilentGhost (SilentGhost) * (Python triager) Date: 2019-03-15 17:04
It's the only function with an optional argument in math, on 3.7 all such function result in ValueError, e.g. getattr, iter, max.
msg338010 - (view) Author: SilentGhost (SilentGhost) * (Python triager) Date: 2019-03-15 17:07
In fact, I don't see anything warranting a separate issue. I'd suggest to close this and perhaps ping Larry instead on the issue 29299 which you mentioned.
msg338012 - (view) Author: Rémi Lapeyre (remi.lapeyre) * Date: 2019-03-15 17:22
Yes you are right, this is actually the same issue. I will try to look for the other attempts Serhiy Storchaka talks about in issue 29299 and ping Larry on this issue.

(I can't set the superseeded flag on this issue thought)
Date User Action Args
2019-03-15 17:24:08SilentGhostsettype: behavior
superseder: Argument Clinic: Fix signature of optional positional-only arguments
2019-03-15 17:22:08remi.lapeyresetstatus: open -> closed
resolution: duplicate
messages: + msg338012

stage: resolved
2019-03-15 17:07:04SilentGhostsetmessages: + msg338010
2019-03-15 17:04:03SilentGhostsetnosy: + SilentGhost
messages: + msg338008
2019-03-15 16:44:25remi.lapeyrecreate