Title: [3.15] gh-149995: Update typing.py docstrings and documentation (GH-149996) by miss-islington · Pull Request #150215 · python/cpython · GitHub
Open Graph Title: [3.15] gh-149995: Update typing.py docstrings and documentation (GH-149996) by miss-islington · Pull Request #150215 · python/cpython
X Title: [3.15] gh-149995: Update typing.py docstrings and documentation (GH-149996) by miss-islington · Pull Request #150215 · python/cpython
Description: Some of these docstrings read as if they were written when typing.py was first written, and things have evolved since then. A few motivations: Call protocols protocols instead of ABCs. They are also ABCs, but the fact they are protocols is more relevant to typing. Avoid recommending direct use of .annotations and steer users to annotationlib instead. For TypedDict, mention NotRequired before total=False since it is more general and probably more frequently useful. For overloads, mention runtime use first instead of stub use. I think early on there was talk of allowing overload only in stubs, but it is now heavily used at runtime too and that's more likely to be relevant to users. (cherry picked from commit f159419) Co-authored-by: Jelle Zijlstra jelle.zijlstra@gmail.com Issue: gh-149995
Open Graph Description: Some of these docstrings read as if they were written when typing.py was first written, and things have evolved since then. A few motivations: Call protocols protocols instead of ABCs. They are al...
X Description: Some of these docstrings read as if they were written when typing.py was first written, and things have evolved since then. A few motivations: Call protocols protocols instead of ABCs. They are al...
Opengraph URL: https://github.com/python/cpython/pull/150215
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:13636faa-efd0-388a-0d1b-262026bb325d |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | A99E:1D3D36:4E4082:6D0838:6A51227E |
| html-safe-nonce | d84eaeeb32a3bac6364c22416644075e9dddbc6ca8f949104acdb10b562aaf36 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBOTlFOjFEM0QzNjo0RTQwODI6NkQwODM4OjZBNTEyMjdFIiwidmlzaXRvcl9pZCI6IjI0MTkyMzE2ODA5MTUxMjA3NjciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | b80606e62bf9f8acf013c8b4be6ab542051498af26b5fe8f84c2f22d2edb2269 |
| hovercard-subject-tag | pull_request:3727857619 |
| 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/cpython/pull/150215/files |
| twitter:image | https://avatars.githubusercontent.com/u/31488909?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/31488909?s=400&v=4 |
| og:image:alt | Some of these docstrings read as if they were written when typing.py was first written, and things have evolved since then. A few motivations: Call protocols protocols instead of ABCs. They are al... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 689b683944b0d7f015d0e776452c970832fa81b82dc15284469b556ecced715b |
| turbo-cache-control | no-preview |
| diff-view | unified |
| 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 |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 942b51ed3bd5feee3d5e2719f890a5fe286edbbb |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width