Erik Welch <erik.n.we...@gmail.com> added the comment:

Thanks for taking a look Terry.  I saw that error as well.  It is separate from 
this issue, and I don't think it is a bug.  No other builtin functions or 
methods that raise this error with this text have such a notice in their 
docstring, so it doesn't seem appropriate to me to add it to the docstring at 
this point in time.

Search for "<unrepresentable>" to find other functions and methods that have 
the same issue.  `dict.pop` is one such example.

`inspect.signature(anext)` and `inspect.signature(next)` both raise ValueError. 
 The text for `next` is what one may hope to see (and why you raise a fair 
point): `"ValueError: no signature found for builtin <built-in function 
next>"`.  The difference between `anext` and `next` in this regard is that 
`anext` uses the argument clinic.  It is the argument clinic that converts 
`NULL` to `"<unrepresentable>"` in the signature text that inspect tries (and 
fails) to parse to get the AST of.

I actually did poke around a bit at having the the Argument Clinic and 
`inspect` module more intelligently pick up this case to give a better error.  
I think this is doable, but should not be part of this bug report.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue43918>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to