Title: Assume there is no bytes/bytearray/memoryview implicit promotion · Issue #9001 · python/typeshed · GitHub
Open Graph Title: Assume there is no bytes/bytearray/memoryview implicit promotion · Issue #9001 · python/typeshed
X Title: Assume there is no bytes/bytearray/memoryview implicit promotion · Issue #9001 · python/typeshed
Description: Currently, we treat bytearray and memoryview as implicit subclasses of bytes, following the CPython documentation. In PEP 688, I propose to remove this implicit promotion. Discussion is still ongoing, but I'd like to make sure typeshed i...
Open Graph Description: Currently, we treat bytearray and memoryview as implicit subclasses of bytes, following the CPython documentation. In PEP 688, I propose to remove this implicit promotion. Discussion is still ongoi...
X Description: Currently, we treat bytearray and memoryview as implicit subclasses of bytes, following the CPython documentation. In PEP 688, I propose to remove this implicit promotion. Discussion is still ongoi...
Opengraph URL: https://github.com/python/typeshed/issues/9001
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Assume there is no bytes/bytearray/memoryview implicit promotion","articleBody":"Currently, we treat `bytearray` and `memoryview` as implicit subclasses of `bytes`, following the CPython documentation. In PEP 688, I propose to remove this implicit promotion. Discussion is still ongoing, but I'd like to make sure typeshed is ready for this change by reviewing existing usage of `bytes`.\r\n\r\nTo make that easier, I propose that we *write stubs as if there is no implicit promotion between `bytes`, `bytearray`, and `memoryview`*. Thus, if a function accepts either `bytes` or `bytearray`, we should write `bytes | bytearray`, not just `bytes`.\r\n\r\nThe only cost here should be that certain argument annotations become longer; everything should still work fine for type checkers that assume the implicit promotion.\r\n\r\nIf we agree on this rule, I can review existing `bytes` annotations for correctness. In my experience, most usages of `bytes` in argument positions should be `ReadableBuffer`.","author":{"url":"https://github.com/JelleZijlstra","@type":"Person","name":"JelleZijlstra"},"datePublished":"2022-10-27T15:32:46Z","url":"https://github.com/python/typeshed/issues/9001"}
| 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:097d9ab4-a1e0-11cf-90ff-fb2ecc0dfc18 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C0FE:43251:1603ED9:1D41CA7:6B0024D1 |
| html-safe-nonce | 89cd47b16d20f9b3258193f4a1868241b903150e37ba3e537fa91dc3c437938a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDMEZFOjQzMjUxOjE2MDNFRDk6MUQ0MUNBNzo2QjAwMjREMSIsInZpc2l0b3JfaWQiOiI0MTI0MTk5MjA5MTI3NjUwNTE0IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 27fd01ee818300c86fc8f03719be1eecebdef7bd1a828d7ab08e7e2557e1aeec |
| hovercard-subject-tag | issue:1425841510 |
| 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/typeshed/9001/issue_layout |
| twitter:image | https://opengraph.githubassets.com/c64b94dc4f1114e733df28f15de58fdcc353c7e5e995c3c0e2c95bba6b53e046/python/typeshed/issues/9001 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/c64b94dc4f1114e733df28f15de58fdcc353c7e5e995c3c0e2c95bba6b53e046/python/typeshed/issues/9001 |
| og:image:alt | Currently, we treat bytearray and memoryview as implicit subclasses of bytes, following the CPython documentation. In PEP 688, I propose to remove this implicit promotion. Discussion is still ongoi... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | JelleZijlstra |
| hostname | github.com |
| expected-hostname | github.com |
| None | 4eb4cba0d69f045374ac15de9666d22b0961e1d555cc3824f36b7734c00c78e0 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/typeshed git https://github.com/python/typeshed.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 31696383 |
| octolytics-dimension-repository_nwo | python/typeshed |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 31696383 |
| octolytics-dimension-repository_network_root_nwo | python/typeshed |
| 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 | 44c658b24abf00491fb7ae5f56d42c9f38cbeab2 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width