Title: sqlite3.Blob indexing is not conformant with existing norms · Issue #92019 · python/cpython · GitHub
Open Graph Title: sqlite3.Blob indexing is not conformant with existing norms · Issue #92019 · python/cpython
X Title: sqlite3.Blob indexing is not conformant with existing norms · Issue #92019 · python/cpython
Description: Yesterday, @JelleZijlstra enlightened me that sqlite3.Blob indexing operate with bytes objects of length 1. This is a deviation from how bytes, bytearray, and memoryview work: >>> bytes(b"0")[0] 48 >>> bytearray(b"0")[0] 48 >>> memoryvie...
Open Graph Description: Yesterday, @JelleZijlstra enlightened me that sqlite3.Blob indexing operate with bytes objects of length 1. This is a deviation from how bytes, bytearray, and memoryview work: >>> bytes(b"0")[0] 48...
X Description: Yesterday, @JelleZijlstra enlightened me that sqlite3.Blob indexing operate with bytes objects of length 1. This is a deviation from how bytes, bytearray, and memoryview work: >>> bytes(b&...
Opengraph URL: https://github.com/python/cpython/issues/92019
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"sqlite3.Blob indexing is not conformant with existing norms","articleBody":"Yesterday, @JelleZijlstra enlightened me that sqlite3.Blob indexing operate with `bytes` objects of length 1. This is a deviation from how `bytes`, `bytearray`, and `memoryview` work:\r\n\r\n```\r\n\u003e\u003e\u003e bytes(b\"0\")[0]\r\n48\r\n\u003e\u003e\u003e bytearray(b\"0\")[0]\r\n48\r\n\u003e\u003e\u003e memoryview(b\"0\")[0]\r\n48\r\n\u003e\u003e\u003e b = bytearray(b\"0\")\r\n\u003e\u003e\u003e b[0] = 1\r\n\u003e\u003e\u003e b[0] = b\"1\"\r\nTraceback (most recent call last):\r\n File \"\u003cstdin\u003e\", line 1, in \u003cmodule\u003e\r\nTypeError: 'bytes' object cannot be interpreted as an integer\r\n\u003e\u003e\u003e m = memoryview(b)\r\n\u003e\u003e\u003e m[0] = 1\r\n\u003e\u003e\u003e m[0] = b\"1\"\r\nTraceback (most recent call last):\r\n File \"\u003cstdin\u003e\", line 1, in \u003cmodule\u003e\r\nTypeError: memoryview: invalid type for format 'B'\r\n\u003e\u003e\u003e \r\n```\r\n\r\nSuggesting to align sqlite3.Blob indexing behaviour so it expects `int`s and returns `int`s.","author":{"url":"https://github.com/erlend-aasland","@type":"Person","name":"erlend-aasland"},"datePublished":"2022-04-28T14:18:52.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":3},"url":"https://github.com/92019/cpython/issues/92019"}
| 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:95648cfb-bb09-e17d-a947-a1c042082e76 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B58C:37CCD2:18DF53F:2137A63:696AEE4E |
| html-safe-nonce | aa6d4ac35a11a0027f927d68b6dcb7f223af262c805df1fddd72708f95f687e4 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCNThDOjM3Q0NEMjoxOERGNTNGOjIxMzdBNjM6Njk2QUVFNEUiLCJ2aXNpdG9yX2lkIjoiNTIzNzE4OTQ3OTMzOTA2MDgxNCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 125b0fa19de893b0ff85b6262e98b11306dc09f6ba43e63b474723df0952a621 |
| hovercard-subject-tag | issue:1218802046 |
| 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/cpython/92019/issue_layout |
| twitter:image | https://opengraph.githubassets.com/b282f54d1688a7349b548d7f2b3b296c932a7307a3484d892ab473eaec0ab766/python/cpython/issues/92019 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/b282f54d1688a7349b548d7f2b3b296c932a7307a3484d892ab473eaec0ab766/python/cpython/issues/92019 |
| og:image:alt | Yesterday, @JelleZijlstra enlightened me that sqlite3.Blob indexing operate with bytes objects of length 1. This is a deviation from how bytes, bytearray, and memoryview work: >>> bytes(b"0")[0] 48... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | erlend-aasland |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5f99f7c1d70f01da5b93e5ca90303359738944d8ab470e396496262c66e60b8d |
| 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 |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 82560a55c6b2054555076f46e683151ee28a19bc |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width