This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author eriknw
Recipients eriknw, pablogsal, terry.reedy
Date 2021-04-25.05:34:52
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1619328893.55.0.758428220267.issue43918@roundup.psfhosted.org>
In-reply-to
Content
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.
History
Date User Action Args
2021-04-25 05:34:53eriknwsetrecipients: + eriknw, terry.reedy, pablogsal
2021-04-25 05:34:53eriknwsetmessageid: <1619328893.55.0.758428220267.issue43918@roundup.psfhosted.org>
2021-04-25 05:34:53eriknwlinkissue43918 messages
2021-04-25 05:34:52eriknwcreate