Title: Incorrect description of the __signature__ attribute in docs · Issue #115937 · python/cpython · GitHub
Open Graph Title: Incorrect description of the __signature__ attribute in docs · Issue #115937 · python/cpython
X Title: Incorrect description of the __signature__ attribute in docs · Issue #115937 · python/cpython
Description: Bug report Bug description: Since #106311 its documented in the inspect.signature() sphinx docs as: "If the passed object has a __signature__ attribute, this function returns it without further computations." That looks correct per PEP 3...
Open Graph Description: Bug report Bug description: Since #106311 its documented in the inspect.signature() sphinx docs as: "If the passed object has a __signature__ attribute, this function returns it without further com...
X Description: Bug report Bug description: Since #106311 its documented in the inspect.signature() sphinx docs as: "If the passed object has a __signature__ attribute, this function returns it without furthe...
Opengraph URL: https://github.com/python/cpython/issues/115937
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Incorrect description of the __signature__ attribute in docs","articleBody":"# Bug report\n\n### Bug description:\n\nSince #106311 its documented in the ``inspect.signature()`` sphinx docs as:\n\"If the passed object has a ``__signature__`` attribute, this function returns it without further computations.\"\n\nThat looks correct per PEP 362, see the [implementation section](https://peps.python.org/pep-0362/#implementation). But actual code logic goes far away from this simple description:\nhttps://github.com/python/cpython/blob/8e8ab75d97f51c2850eb8cd711010662d5f1d360/Lib/inspect.py#L2549-L2562\n\nEither we should document this properly (then this is a documentation issue). Or we could change the code and remove undocumented logic. As this attribute was documented recently, I'll suggest the second option.\n\n### CPython versions tested on:\n\nCPython main branch\n\n### Operating systems tested on:\n\n_No response_\n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-115984\n* gh-116086\n* gh-116106\n* gh-116107\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/skirpichev","@type":"Person","name":"skirpichev"},"datePublished":"2024-02-26T09:30:37.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":8},"url":"https://github.com/115937/cpython/issues/115937"}
| 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:a298007e-7881-051e-1713-47d472a5e7a2 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | AEA0:18C2EF:FEA8A8:15247C5:69699268 |
| html-safe-nonce | e377e35ed99580eb56acc2881be3d274be83598941f4c6701a828103673d8d87 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBRUEwOjE4QzJFRjpGRUE4QTg6MTUyNDdDNTo2OTY5OTI2OCIsInZpc2l0b3JfaWQiOiI3MDg5NjM1MjYyMzgyODM4Mzc2IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | a778a1e12fcd4b9ba4e3ae353f3f0c9d481605ea70f17caecbfdb91ac30a005d |
| hovercard-subject-tag | issue:2153685542 |
| 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/115937/issue_layout |
| twitter:image | https://opengraph.githubassets.com/e79ee19b5f6149489dc4ef5d015f2260d198d8031d85bc8eee3de798095f8fd5/python/cpython/issues/115937 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/e79ee19b5f6149489dc4ef5d015f2260d198d8031d85bc8eee3de798095f8fd5/python/cpython/issues/115937 |
| og:image:alt | Bug report Bug description: Since #106311 its documented in the inspect.signature() sphinx docs as: "If the passed object has a __signature__ attribute, this function returns it without further com... |
| 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 | 3542e147982176a7ebaa23dfb559c8af16f721c03ec560c68c56b64a0f35e751 |
| 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 | af80af7cc9e3de9c336f18b208a600950a3c187c |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width