Message391839
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. |
|
Date |
User |
Action |
Args |
2021-04-25 05:34:53 | eriknw | set | recipients:
+ eriknw, terry.reedy, pablogsal |
2021-04-25 05:34:53 | eriknw | set | messageid: <1619328893.55.0.758428220267.issue43918@roundup.psfhosted.org> |
2021-04-25 05:34:53 | eriknw | link | issue43918 messages |
2021-04-25 05:34:52 | eriknw | create | |
|