Title: Inheriting from collections.MutableMapping and typing.MutableMapping breaks MutableMapping.register · Issue #222 · python/typing · GitHub
Open Graph Title: Inheriting from collections.MutableMapping and typing.MutableMapping breaks MutableMapping.register · Issue #222 · python/typing
X Title: Inheriting from collections.MutableMapping and typing.MutableMapping breaks MutableMapping.register · Issue #222 · python/typing
Description: import collections from typing import MutableMapping, TypeVar, Generic _KT = TypeVar('_KT') _VT = TypeVar('_VT') class MyMutableMapping(collections.MutableMapping, MutableMapping[_KT, _VT], Generic[_KT, _VT]): pass class OtherMutableMapp...
Open Graph Description: import collections from typing import MutableMapping, TypeVar, Generic _KT = TypeVar('_KT') _VT = TypeVar('_VT') class MyMutableMapping(collections.MutableMapping, MutableMapping[_KT, _VT], Generic...
X Description: import collections from typing import MutableMapping, TypeVar, Generic _KT = TypeVar('_KT') _VT = TypeVar('_VT') class MyMutableMapping(collections.MutableMapping, MutableMapping[_K...
Opengraph URL: https://github.com/python/typing/issues/222
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Inheriting from collections.MutableMapping and typing.MutableMapping breaks MutableMapping.register","articleBody":"```\nimport collections\nfrom typing import MutableMapping, TypeVar, Generic\n\n_KT = TypeVar('_KT')\n_VT = TypeVar('_VT')\n\nclass MyMutableMapping(collections.MutableMapping, MutableMapping[_KT, _VT], Generic[_KT, _VT]):\n pass\n\nclass OtherMutableMapping(object):\n pass\n\ncollections.MutableMapping.register(OtherMutableMapping)\n```\n\nRunning this code under python2 results in the following error:\n\n```\nraceback (most recent call last):\n File \"t2.py\", line 13, in \u003cmodule>\n collections.MutableMapping.register(OtherMutableMapping)\n File \"/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/abc.py\", line 109, in register\n if issubclass(subclass, cls):\n File \"/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/abc.py\", line 180, in __subclasscheck__\n if issubclass(subclass, scls):\n File \"/usr/local/lib/python2.7/site-packages/typing.py\", line 1056, in __subclasscheck__\n return issubclass(cls, self.__extra__)\n File \"/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/abc.py\", line 180, in __subclasscheck__\n if issubclass(subclass, scls):\n File \"/usr/local/lib/python2.7/site-packages/typing.py\", line 1056, in __subclasscheck__\n return issubclass(cls, self.__extra__)\n File \"/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/abc.py\", line 180, in __subclasscheck__\n\u003csnip>\n if issubclass(subclass, scls):\n File \"/usr/local/lib/python2.7/site-packages/typing.py\", line 1056, in __subclasscheck__\n return issubclass(cls, self.__extra__)\n File \"/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/abc.py\", line 180, in __subclasscheck__\n if issubclass(subclass, scls):\n File \"/usr/local/lib/python2.7/site-packages/typing.py\", line 1056, in __subclasscheck__\n return issubclass(cls, self.__extra__)\n File \"/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/abc.py\", line 151, in __subclasscheck__\n if subclass in cls._abc_cache:\nRuntimeError: maximum recursion depth exceeded\n```\n","author":{"url":"https://github.com/euresti","@type":"Person","name":"euresti"},"datePublished":"2016-05-17T23:10:28Z","url":"https://github.com/python/typing/issues/222"}
| 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:6ded2f33-b0c1-3806-4b38-85bb12d4035c |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A14C:144E47:2CFB347:3B3A2F1:6B0019A5 |
| html-safe-nonce | 5caf32ea6703a5755f90107d51d3c84a17fd5b1572fe1a25493d389e36336f70 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBMTRDOjE0NEU0NzoyQ0ZCMzQ3OjNCM0EyRjE6NkIwMDE5QTUiLCJ2aXNpdG9yX2lkIjoiNjc0MTQzNzUzMDY2ODgwMDQyMSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 0da8434010c55d1cfc215b172a9c7c9056fe2f29a99159e9e0bdb16cddfe4633 |
| hovercard-subject-tag | issue:155383366 |
| 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/222/issue_layout |
| twitter:image | https://opengraph.githubassets.com/42e4ee46aaa9ed3ffcfa3ddbe3da9d0e3d09aadfe1788324151b00f176a00735/python/typing/issues/222 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/42e4ee46aaa9ed3ffcfa3ddbe3da9d0e3d09aadfe1788324151b00f176a00735/python/typing/issues/222 |
| og:image:alt | import collections from typing import MutableMapping, TypeVar, Generic _KT = TypeVar('_KT') _VT = TypeVar('_VT') class MyMutableMapping(collections.MutableMapping, MutableMapping[_KT, _VT], Generic... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | euresti |
| 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