Title: Accommodate Sphinx option by changing docstring return type of "integer" to "int". · Issue #100989 · python/cpython · GitHub
Open Graph Title: Accommodate Sphinx option by changing docstring return type of "integer" to "int". · Issue #100989 · python/cpython
X Title: Accommodate Sphinx option by changing docstring return type of "integer" to "int". · Issue #100989 · python/cpython
Description: Bug report When collections.deque is subclassed and the resulting class is documented with Sphinx using the option :inherited-members:, the following error appears: WARNING: py:class reference target not found: integer -- return number o...
Open Graph Description: Bug report When collections.deque is subclassed and the resulting class is documented with Sphinx using the option :inherited-members:, the following error appears: WARNING: py:class reference targ...
X Description: Bug report When collections.deque is subclassed and the resulting class is documented with Sphinx using the option :inherited-members:, the following error appears: WARNING: py:class reference targ...
Opengraph URL: https://github.com/python/cpython/issues/100989
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Accommodate Sphinx option by changing docstring return type of \"integer\" to \"int\".","articleBody":"# Bug report\r\n\r\nWhen `collections.deque` is subclassed and the resulting class is documented with Sphinx using the option `:inherited-members:`, the following error appears:\r\n```\r\nWARNING: py:class reference target not found: integer -- return number of occurrences of value\r\n```\r\n\r\nI assume this is because the `PyDoc_STRVAR` docstring of the C-implementation is not compliant to [PEP-7](https://peps.python.org/pep-0007/#documentation-strings) as required in [`PyDoc_STRVAR`](https://docs.python.org/3/c-api/intro.html#c.PyDoc_STRVAR):\r\nhttps://github.com/python/cpython/blob/d9dff4c8b5ab41c47af002ad7fb083c953e75f31/Modules/_collectionsmodule.c#L992-L993\r\n\r\nAnd everything after `-\u003e` is interpreted as type hint.\r\n\r\nThis can be reproduced with e.g. a python module `sub_deque.py`:\r\n```\r\nclass SubDeque(deque):\r\n pass\r\n```\r\nand a documenation file `docs/src/sub_deque.rst`:\r\n```\r\n.. automodule:: sub_deque\r\n :inherited-members:\r\n```\r\nwhich is then built with Sphinx: `sphinx-build -W docs/src docs/dist`.\r\n\r\n\r\nI'd be happy to provide a patch for this myself if you feel this issue should be fixed.\r\n\r\n# Your environment\r\n\r\n\u003c!-- Include as many relevant details as possible about the environment you experienced the bug in --\u003e\r\n\r\n- CPython versions tested on: 3.7 - 3.11\r\n- Operating system and architecture: Arch Linux \u0026 Ubuntu\r\n\n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-100990\n* gh-102910\n* gh-102911\n* gh-102949\n* gh-102979\n* gh-102984\n* gh-102985\n* gh-102991\n* gh-102992\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/timobrembeck","@type":"Person","name":"timobrembeck"},"datePublished":"2023-01-12T15:12:48.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":16},"url":"https://github.com/100989/cpython/issues/100989"}
| 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:347a994a-62a2-f187-46e5-e6454dc92088 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B432:31FE0A:1407FD2:1BF406A:696A4082 |
| html-safe-nonce | c44b0c22c30a9b3699c18b705c1f91b4132a46ea84e7e8627fe4600ce3e0cbc5 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCNDMyOjMxRkUwQToxNDA3RkQyOjFCRjQwNkE6Njk2QTQwODIiLCJ2aXNpdG9yX2lkIjoiNjc1MTg5MDc2Mzc4MTEyODMyMiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 3a3ec17eb2bdd85ab1785ccf70fd91c148e0d0c35f32c964bd9ba6652826c82d |
| hovercard-subject-tag | issue:1530887440 |
| 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/100989/issue_layout |
| twitter:image | https://opengraph.githubassets.com/14bf8efe9a8811e973b8bcc422db4cf41258e69b8e18af87bd46857adbd5971b/python/cpython/issues/100989 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/14bf8efe9a8811e973b8bcc422db4cf41258e69b8e18af87bd46857adbd5971b/python/cpython/issues/100989 |
| og:image:alt | Bug report When collections.deque is subclassed and the resulting class is documented with Sphinx using the option :inherited-members:, the following error appears: WARNING: py:class reference targ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | timobrembeck |
| hostname | github.com |
| expected-hostname | github.com |
| None | 321736bfdb3f591415ae895a0459bec204b26a76caf47ba5c980634cfacc4538 |
| 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 | 13581a31d51edf4a3aca179e10890a4d4f9b6d76 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width