Title: invalid signature for math.hypot · Issue #101123 · python/cpython · GitHub
Open Graph Title: invalid signature for math.hypot · Issue #101123 · python/cpython
X Title: invalid signature for math.hypot · Issue #101123 · python/cpython
Description: >>> import math >>> import inspect >>> inspect.signature(math.hypot) Traceback (most recent call last): File "
Open Graph Description: >>> import math >>> import inspect >>> inspect.signature(math.hypot) Traceback (most recent call last): File "
X Description: >>> import math >>> import inspect >>> inspect.signature(math.hypot) Traceback (most recent call last): File "<stdin>", line 1, in <module> File &qu...
Opengraph URL: https://github.com/python/cpython/issues/101123
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"invalid signature for math.hypot","articleBody":"```python\r\n\u003e\u003e\u003e import math\r\n\u003e\u003e\u003e import inspect\r\n\u003e\u003e\u003e inspect.signature(math.hypot) \r\nTraceback (most recent call last):\r\n File \"\u003cstdin\u003e\", line 1, in \u003cmodule\u003e\r\n File \"/home/sk/src/cpython/Lib/inspect.py\", line 3295, in signature\r\n return Signature.from_callable(obj, follow_wrapped=follow_wrapped,\r\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\n File \"/home/sk/src/cpython/Lib/inspect.py\", line 3039, in from_callable\r\n return _signature_from_callable(obj, sigcls=cls,\r\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\n File \"/home/sk/src/cpython/Lib/inspect.py\", line 2531, in _signature_from_callable\r\n return _signature_from_builtin(sigcls, obj,\r\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\n File \"/home/sk/src/cpython/Lib/inspect.py\", line 2330, in _signature_from_builtin\r\n raise ValueError(\"no signature found for builtin {!r}\".format(func))\r\nValueError: no signature found for builtin \u003cbuilt-in function hypot\u003e\r\n```\r\n\r\nThis patch works:\r\n```diff\r\ndiff --git a/Modules/mathmodule.c b/Modules/mathmodule.c\r\nindex 1342162fa7..0e610eb9cb 100644\r\n--- a/Modules/mathmodule.c\r\n+++ b/Modules/mathmodule.c\r\n@@ -2805,7 +2805,9 @@ math_hypot(PyObject *self, PyObject *const *args, Py_ssize_t nargs)\r\n #undef NUM_STACK_ELEMS\r\n \r\n PyDoc_STRVAR(math_hypot_doc,\r\n- \"hypot(*coordinates) -\u003e value\\n\\n\\\r\n+ \"hypot($module, *coordinates)\\n\\\r\n+--\\n\\\r\n+\\n\\\r\n Multidimensional Euclidean distance from the origin to a point.\\n\\\r\n \\n\\\r\n Roughly equivalent to:\\n\\\r\n```\r\n\n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-101124\n* gh-126235\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/skirpichev","@type":"Person","name":"skirpichev"},"datePublished":"2023-01-18T09:19:55.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":5},"url":"https://github.com/101123/cpython/issues/101123"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:7041aec8-1b86-a921-a637-6966eeba0c9e |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A8F4:2DD042:4679F3:5C440C:696B420D |
| html-safe-nonce | cd8b4ecf1f5562a9579edd1f3b92614b5804aa741fe8a775215a881b7089440d |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBOEY0OjJERDA0Mjo0Njc5RjM6NUM0NDBDOjY5NkI0MjBEIiwidmlzaXRvcl9pZCI6IjM3ODY3MjYyMjU0NDY5MTI1MjUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 6359208a90f7f6b3a7c9e0ecf6802234721a09297ef576343a8fe4c351c7bd0e |
| hovercard-subject-tag | issue:1537659514 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/101123/issue_layout |
| twitter:image | https://opengraph.githubassets.com/2d44f5d8da93bfadfe6dc932f208dd5a6e5a8b5bca65fe6bf0ca9db987575b86/python/cpython/issues/101123 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/2d44f5d8da93bfadfe6dc932f208dd5a6e5a8b5bca65fe6bf0ca9db987575b86/python/cpython/issues/101123 |
| og:image:alt | >>> import math >>> import inspect >>> inspect.signature(math.hypot) Traceback (most recent call last): File " |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | skirpichev |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5f99f7c1d70f01da5b93e5ca90303359738944d8ab470e396496262c66e60b8d |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 82560a55c6b2054555076f46e683151ee28a19bc |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width