Title: Subclasses of typing.Sequence (&c) pretend to be superclasses of all registered members of abc.Sequence (&c) · Issue #268 · python/typing · GitHub
Open Graph Title: Subclasses of typing.Sequence (&c) pretend to be superclasses of all registered members of abc.Sequence (&c) · Issue #268 · python/typing
X Title: Subclasses of typing.Sequence (&c) pretend to be superclasses of all registered members of abc.Sequence (&c) · Issue #268 · python/typing
Description: Check this out yo: In [1]: from typing import Sequence In [2]: class DumbSeq(Sequence): pass In [3]: issubclass(tuple, DumbSeq) Out[3]: True This has to do with the implementation of GenericMeta, where our __subclasscheck__ ends with thi...
Open Graph Description: Check this out yo: In [1]: from typing import Sequence In [2]: class DumbSeq(Sequence): pass In [3]: issubclass(tuple, DumbSeq) Out[3]: True This has to do with the implementation of GenericMeta, w...
X Description: Check this out yo: In [1]: from typing import Sequence In [2]: class DumbSeq(Sequence): pass In [3]: issubclass(tuple, DumbSeq) Out[3]: True This has to do with the implementation of GenericMeta, w...
Opengraph URL: https://github.com/python/typing/issues/268
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Subclasses of typing.Sequence (&c) pretend to be superclasses of all registered members of abc.Sequence (&c)","articleBody":"Check this out yo:\n\n```\nIn [1]: from typing import Sequence\nIn [2]: class DumbSeq(Sequence): pass\nIn [3]: issubclass(tuple, DumbSeq)\nOut[3]: True\n```\n\nThis has to do with the implementation of `GenericMeta`, where our `__subclasscheck__` ends with this line:\n\n``` python\n return issubclass(cls, self.__extra__)\n```\n\nAnd for the container classes in `typing`, they're defined to have the `collections.abc` classes as their `__extra__`.\n\nPondering a fix to suggest.\n","author":{"url":"https://github.com/sixolet","@type":"Person","name":"sixolet"},"datePublished":"2016-08-25T00:22:53Z","url":"https://github.com/python/typing/issues/268"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| 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:6e33f737-154d-2664-aa24-4a6045f73c48 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9318:1DD784:19D73:22DBE:6B0019A3 |
| html-safe-nonce | 6fd14b50745b4979e8b68e055945d6fdfb6c4a3ee4853db6ac91afd77543a88e |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MzE4OjFERDc4NDoxOUQ3MzoyMkRCRTo2QjAwMTlBMyIsInZpc2l0b3JfaWQiOiIyMjYwMDI0Njk5MzI3MDkzMTU1IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | dc192a0f171c7b4e5bca4953121d43e95f89266bb639eaaded3f966863db26d2 |
| hovercard-subject-tag | issue:173088167 |
| 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/typing/268/issue_layout |
| twitter:image | https://opengraph.githubassets.com/c57364c9d52102356d57fce33801fa4bd7012c7758883238ac22eb17ea7369cc/python/typing/issues/268 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/c57364c9d52102356d57fce33801fa4bd7012c7758883238ac22eb17ea7369cc/python/typing/issues/268 |
| og:image:alt | Check this out yo: In [1]: from typing import Sequence In [2]: class DumbSeq(Sequence): pass In [3]: issubclass(tuple, DumbSeq) Out[3]: True This has to do with the implementation of GenericMeta, w... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | sixolet |
| hostname | github.com |
| expected-hostname | github.com |
| None | a2dd2291b1b13cc9c06f27ec92fa3dbaf34116fc24c9347b8539db61884c59f4 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/typing git https://github.com/python/typing.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 24604008 |
| octolytics-dimension-repository_nwo | python/typing |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 24604008 |
| octolytics-dimension-repository_network_root_nwo | python/typing |
| 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 | 70121d4e855ee0bb7b75cf15d061d91f8863c0f8 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width