Title: Prepend bases on first subscription by ilevkivskyi · Pull Request #386 · python/typing · GitHub
Open Graph Title: Prepend bases on first subscription by ilevkivskyi · Pull Request #386 · python/typing
X Title: Prepend bases on first subscription by ilevkivskyi · Pull Request #386 · python/typing
Description: Fixes #385 Fixes #384 In previous versions of typing, __bases__ on subscription where prepend with __origin__, so that MRO of, e.g., Mapping[int, T][str] was: [Mapping[int, str], Mapping[int, T], Mapping, collections.abc.Mapping, ...] This was removed for several reasons. However, now it looks like complete removal of such prepending was too radical, since now e.g. issublcass(Node[int], Node) returns False. I believe such runtime check should be equivalent to issublcass(Node, Node), i.e., True. Here I propose to fix this by only prepending __bases__ on first subscription, so that, e.g, Mapping[int, T][str].__mro__ will be: [Mapping[int, str], Mapping, collections.abc.Mapping, ...] This PR also fixes an ambiguity when using typing ABCs with singledispatch().
Open Graph Description: Fixes #385 Fixes #384 In previous versions of typing, __bases__ on subscription where prepend with __origin__, so that MRO of, e.g., Mapping[int, T][str] was: [Mapping[int, str], Mapping[int, T], M...
X Description: Fixes #385 Fixes #384 In previous versions of typing, __bases__ on subscription where prepend with __origin__, so that MRO of, e.g., Mapping[int, T][str] was: [Mapping[int, str], Mapping[int, T], M...
Opengraph URL: https://github.com/python/typing/pull/386
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/commits/:range(.:format) |
| route-controller | pull_requests |
| route-action | commits |
| fetch-nonce | v2:0a3c8983-e989-f629-d744-7e1b4129d433 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | AA14:29889E:788106:9CB651:69965DEA |
| html-safe-nonce | 58e7ca06bcaaa1407e9fa63a1db1233d606582c803061fef4c215375f1da9378 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBQTE0OjI5ODg5RTo3ODgxMDY6OUNCNjUxOjY5OTY1REVBIiwidmlzaXRvcl9pZCI6IjEyMDQzNTk3NDQxMTIxODg5MDYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 74336cf9687f867035dd9b41ea0fc3fdf813d451b6c5d479065fcb8c6251da65 |
| hovercard-subject-tag | pull_request:104498073 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,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/python/typing/pull/386/commits/2f7b03bac7419f325fc0766e09f347cf3320bca4 |
| twitter:image | https://avatars.githubusercontent.com/u/12005495?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/12005495?s=400&v=4 |
| og:image:alt | Fixes #385 Fixes #384 In previous versions of typing, __bases__ on subscription where prepend with __origin__, so that MRO of, e.g., Mapping[int, T][str] was: [Mapping[int, str], Mapping[int, T], M... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | bb5fc598983958d677e5179b50e71c2bfa2a8ac1568110d429775cd645bbe799 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| 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 full-width |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | db215ff24c4b7248f8b34cafbe2f845e4cbbeb37 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width