Title: Invalid class description of set/frozenset in docs · Issue #114336 · python/cpython · GitHub
Open Graph Title: Invalid class description of set/frozenset in docs · Issue #114336 · python/cpython
X Title: Invalid class description of set/frozenset in docs · Issue #114336 · python/cpython
Description: The class sphinx directive is used (see it's docs), but wrongly: cpython/Doc/library/stdtypes.rst Lines 4251 to 4258 in 6313cdd .. class:: set([iterable]) frozenset([iterable]) Return a new set or frozenset object whose elements are take...
Open Graph Description: The class sphinx directive is used (see it's docs), but wrongly: cpython/Doc/library/stdtypes.rst Lines 4251 to 4258 in 6313cdd .. class:: set([iterable]) frozenset([iterable]) Return a new set or ...
X Description: The class sphinx directive is used (see it's docs), but wrongly: cpython/Doc/library/stdtypes.rst Lines 4251 to 4258 in 6313cdd .. class:: set([iterable]) frozenset([iterable]) Return a new set...
Opengraph URL: https://github.com/python/cpython/issues/114336
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Invalid class description of set/frozenset in docs","articleBody":"The ``class`` sphinx directive is used (see [it's docs](https://www.sphinx-doc.org/en/master/usage/domains/python.html#directive-py-class)), but wrongly:\r\nhttps://github.com/python/cpython/blob/6313cdde58f34648a430d2830357c9d2a5b67b87/Doc/library/stdtypes.rst#L4251-L4258\r\nIt looks (despite this seems to be not documented in sphinx-doc), that the second signature takes precedence and methods below could be referenced (either internally in CPython or with the intersphinx for external projects) only like ``frozenset.foo``, which is especially silly in cases like ``frozenset.add``.\r\n\r\nWe could mitigate this by reordering set and frozenset in the ``class`` directive (references to set's methods are more common), but this is not a real solution.\r\n\r\nOne option to solve the problem is using two ``class`` directives (like for list/tuple). BTW, while technically the set is not a subtype of the frozenset, in fact it just has some overloaded ops and a bunch of new methods...\r\n\r\nAnother option is a new sphinx directive like ``currentmodule``: \"Directive `currentclass` (similar to `currentmodule`) would help us.\" _Originally posted by @serhiy-storchaka in https://github.com/python/cpython/issues/114280#issuecomment-1900305597_\r\n\r\nFinally, it could be viewed as a sphinx-only issue: the class directive must support references for every declared signature (i.e. both ``set.add`` and ``frozenset.add``).","author":{"url":"https://github.com/skirpichev","@type":"Person","name":"skirpichev"},"datePublished":"2024-01-20T02:50:48.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":7},"url":"https://github.com/114336/cpython/issues/114336"}
| 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:2d932c07-ee22-2b0f-446d-eccf5f445c27 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8F6E:D3153:73CED4:953CB2:696B1507 |
| html-safe-nonce | c189402ba4449a36558714992a623f715f7879629bcf4f88f4b7c3d0a7e4b12d |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4RjZFOkQzMTUzOjczQ0VENDo5NTNDQjI6Njk2QjE1MDciLCJ2aXNpdG9yX2lkIjoiMzE3OTA2MTk5NDU3MjE1ODIxNSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 843b731279785491c7baabc0c7cf2db956fc7e4ba452ad1c7d40edbd880c5833 |
| hovercard-subject-tag | issue:2091840221 |
| 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/114336/issue_layout |
| twitter:image | https://opengraph.githubassets.com/3d621d3a2d3cf04faae7ee6f258eb171a52d17a23f85c3b41601884b4fbffcdf/python/cpython/issues/114336 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/3d621d3a2d3cf04faae7ee6f258eb171a52d17a23f85c3b41601884b4fbffcdf/python/cpython/issues/114336 |
| og:image:alt | The class sphinx directive is used (see it's docs), but wrongly: cpython/Doc/library/stdtypes.rst Lines 4251 to 4258 in 6313cdd .. class:: set([iterable]) frozenset([iterable]) Return a new set or ... |
| 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