Title: ByteString, specifying length for any bytes-like variable · Issue #997 · python/typing · GitHub
Open Graph Title: ByteString, specifying length for any bytes-like variable · Issue #997 · python/typing
X Title: ByteString, specifying length for any bytes-like variable · Issue #997 · python/typing
Description: This request is a combination of two additions to ByteString that apparently are not supported yet, or at least I could find no discussion of them. Support any bytes-like buffers, not only bytes, bytearray and memoryview Allow specifying...
Open Graph Description: This request is a combination of two additions to ByteString that apparently are not supported yet, or at least I could find no discussion of them. Support any bytes-like buffers, not only bytes, b...
X Description: This request is a combination of two additions to ByteString that apparently are not supported yet, or at least I could find no discussion of them. Support any bytes-like buffers, not only bytes, b...
Opengraph URL: https://github.com/python/typing/issues/997
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"ByteString, specifying length for any bytes-like variable","articleBody":"This request is a combination of two additions to `ByteString` that apparently are not supported yet, or at least I could find no discussion of them.\r\n\r\n- Support any bytes-like buffers, not only `bytes`, `bytearray` and `memoryview`\r\n- Allow specifying the length of the buffer expected (in my case it usually must be exactly 32 bytes)\r\n\r\nIdeally, Python typing would allow specifying bytes-like of (a) any length, (b) fixed length or (c) min and/or max length. Potentially also separately specifying if a writable buffer is expected.\r\n\r\nWhile I don't expect for mypy to be able to check for all of that, it would at least be nice to include such information in the annotations for documentation purposes, avoiding the use of docstrings for parameter definitions where names and types are descriptive enough. Is there any way to do this without causing mypy errors, considering that I would rather have no type checking but documentative annotations than what the current implementation can do?\r\n","author":{"url":"https://github.com/covert-encryption","@type":"Person","name":"covert-encryption"},"datePublished":"2021-12-31T15:27:00Z","url":"https://github.com/python/typing/issues/997"}
| 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:68a16b3b-7a6b-6780-bbab-bbab00748d52 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | AFE0:30501:539A9B:713E82:6B003276 |
| html-safe-nonce | 7fc85dbc831ed3d2cb8a982c76ad32a31fbb34b5b9858757d16a937a7caa4e83 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBRkUwOjMwNTAxOjUzOUE5Qjo3MTNFODI6NkIwMDMyNzYiLCJ2aXNpdG9yX2lkIjoiMTk0OTAzMDE5NzY0MjY3MDcxMCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 93b312ab47382f619781f0e83a94759f7c0039a008189dc4862d48980cd92f4d |
| hovercard-subject-tag | issue:1091604967 |
| 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/997/issue_layout |
| twitter:image | https://opengraph.githubassets.com/31f8e5feabfa4c3a6ecd5228528f8ed9539fd59fba7e82c1d9933cbbdc5bf8c1/python/typing/issues/997 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/31f8e5feabfa4c3a6ecd5228528f8ed9539fd59fba7e82c1d9933cbbdc5bf8c1/python/typing/issues/997 |
| og:image:alt | This request is a combination of two additions to ByteString that apparently are not supported yet, or at least I could find no discussion of them. Support any bytes-like buffers, not only bytes, b... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | covert-encryption |
| hostname | github.com |
| expected-hostname | github.com |
| None | 7d0829bbde9e48b2486cb5dd6d147896eb01d32134627091f818958a935ef3f0 |
| 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 | f3f3a43ca095cdea3abbb394112e971f9fdb94fa |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width