Title: `Protocol` should be documented as using `ABCMeta` as metaclass · Issue #127677 · python/cpython · GitHub
Open Graph Title: `Protocol` should be documented as using `ABCMeta` as metaclass · Issue #127677 · python/cpython
X Title: `Protocol` should be documented as using `ABCMeta` as metaclass · Issue #127677 · python/cpython
Description: Documentation Came up in #127648. Currently the documentation for typing.Protocol doesn't mention that Protocol has ABCMeta in its metaclasses (indirectly via _ProtocolMeta) and that its methods can (should?) be marked with @abstractmeth...
Open Graph Description: Documentation Came up in #127648. Currently the documentation for typing.Protocol doesn't mention that Protocol has ABCMeta in its metaclasses (indirectly via _ProtocolMeta) and that its methods ca...
X Description: Documentation Came up in #127648. Currently the documentation for typing.Protocol doesn't mention that Protocol has ABCMeta in its metaclasses (indirectly via _ProtocolMeta) and that its method...
Opengraph URL: https://github.com/python/cpython/issues/127677
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"`Protocol` should be documented as using `ABCMeta` as metaclass","articleBody":"# Documentation\r\n\r\nCame up in #127648.\r\n\r\nCurrently the [documentation for typing.Protocol](https://docs.python.org/3/library/typing.html#typing.Protocol) doesn't mention that `Protocol` has `ABCMeta` in its metaclasses (indirectly via `_ProtocolMeta`) and that its methods can (should?) be marked with `@abstractmethod`. In fact, neither the string \"ABCMeta\" nor \"abstractmethod\" appear in the documentation for the `typing` module.\r\n\r\nI also suggest to add `@abstractmethod` to the examples using a `Protocol` as that is probably a best practice.\r\n\r\nFinally, the documentation for `Protocol` suggests to see PEP 544 for more details. I don't think this is particularly helpful. All information relevant for users should be in the main documentation. PEP 544 should only be suggested as a historical document. (And I don't suggest to directly link to the typing spec, either, although a general link at the top of the page would be useful.)","author":{"url":"https://github.com/srittau","@type":"Person","name":"srittau"},"datePublished":"2024-12-06T10:57:16.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/127677/cpython/issues/127677"}
| 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:c17d889d-f847-6f25-9ad0-758cb7467515 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D3B4:9775E:721FEB9:9FF5BA0:6A5076F4 |
| html-safe-nonce | f39763a1166ba36d91909d88928a3e805eda814a52176065b72730f60ef1517d |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEM0I0Ojk3NzVFOjcyMUZFQjk6OUZGNUJBMDo2QTUwNzZGNCIsInZpc2l0b3JfaWQiOiIxMjAzODg0MjkwMTE3NzcyNjgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 66758492dfafd5c6f152d74d707307b2fe5a00a928d91f19346ea9f9f8c13f16 |
| hovercard-subject-tag | issue:2722711077 |
| 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/127677/issue_layout |
| twitter:image | https://opengraph.githubassets.com/8b731cdc4473540a5d7ee7db3f473ca58f284cd5f5fbc42de41e8205320115e5/python/cpython/issues/127677 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/8b731cdc4473540a5d7ee7db3f473ca58f284cd5f5fbc42de41e8205320115e5/python/cpython/issues/127677 |
| og:image:alt | Documentation Came up in #127648. Currently the documentation for typing.Protocol doesn't mention that Protocol has ABCMeta in its metaclasses (indirectly via _ProtocolMeta) and that its methods ca... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | srittau |
| hostname | github.com |
| expected-hostname | github.com |
| None | d6dc8294eb500fa36bbc57472d61fe87c522f9c3c1d64f70f4926f66a66a7efb |
| 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 | 7ac0ad2f2c7e4b9056617355fd9e33e22b0c8df9 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width