Title: bpo-39481: Implementation for PEP 585 by gvanrossum · Pull Request #18239 · python/cpython · GitHub
Open Graph Title: bpo-39481: Implementation for PEP 585 by gvanrossum · Pull Request #18239 · python/cpython
X Title: bpo-39481: Implementation for PEP 585 by gvanrossum · Pull Request #18239 · python/cpython
Description: I consider this a finished prototype now. We've got everything working, and then some (e.g. pickle), and while we found a fair number of minor issues with PEP 585, the main conclusion is that the PEP is quite reasonable to implement. A number of suggestions for changes PEP 585 that have basically been vetted by @ambv can be found in python/peps#1289. There are a few places where I still disagree with @ambv. In particular, I don't think it makes sense to even allow isinstance(x, list[int]) and issubclass(C, list[int]) -- IMO these should just raise TypeError, and that's what this PR implements. (If @ambv convinces me to change my mind, it's easy to revert that.) [UPDATE: @ambv agrees and has updated the PEP.] There are also a few things that ought to be changed: We should add a nice docstring to GenericAlias. We made io.IOBase generic. This was a misunderstanding, and we'll revert that. The __parameters__ attribute can and probably should be computed lazily the first time it's needed. Maybe we still need a cache, like typing.py uses? Where should the code live? For now I put it in descrobject.c, but that's debatable (it was just convenient). https://bugs.python.org/issue39481
Open Graph Description: I consider this a finished prototype now. We've got everything working, and then some (e.g. pickle), and while we found a fair number of minor issues with PEP 585, the main conclusion is that t...
X Description: I consider this a finished prototype now. We've got everything working, and then some (e.g. pickle), and while we found a fair number of minor issues with PEP 585, the main conclusion is th...
Opengraph URL: https://github.com/python/cpython/pull/18239
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/checks(.:format) |
| route-controller | pull_requests |
| route-action | checks |
| fetch-nonce | v2:cf10e6bb-2d11-1535-df6e-0b17d47b32bf |
| current-catalog-service-hash | 87dc3bc62d9b466312751bfd5f889726f4f1337bdff4e8be7da7c93d6c00a25a |
| request-id | CC24:297F82:16CAE84:1F756EF:696AA9DA |
| html-safe-nonce | 38f0b1eed22e2b386fb3868c46a62c5c0f77bd9e626fd6aeb98a7fe34be2a993 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDQzI0OjI5N0Y4MjoxNkNBRTg0OjFGNzU2RUY6Njk2QUE5REEiLCJ2aXNpdG9yX2lkIjoiNDU5MTA2ODAwMzkyMTczNDEwNiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | fac220b7ee6c5cce161d066386f68695a1e3426199e616ca8556206d07cfb5b9 |
| hovercard-subject-tag | pull_request:368083803 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,checks,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/cpython/pull/18239/checks |
| twitter:image | https://avatars.githubusercontent.com/u/2894642?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/2894642?s=400&v=4 |
| og:image:alt | I consider this a finished prototype now. We've got everything working, and then some (e.g. pickle), and while we found a fair number of minor issues with PEP 585, the main conclusion is that t... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 3eaf9b8cf1badcd7041a8ad480b9d9b28bea0ef1cc821ca9ff20f2cc7f4fe4b9 |
| 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 full-width full-width-p-0 |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | dd9a979046e6382bd084e2bd873bf65f797125ff |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width