Title: Shouldn't FileIO indicate None as possible return of read/write? · Issue #12684 · python/typeshed · GitHub
Open Graph Title: Shouldn't FileIO indicate None as possible return of read/write? · Issue #12684 · python/typeshed
X Title: Shouldn't FileIO indicate None as possible return of read/write? · Issue #12684 · python/typeshed
Description: Typeshed currently has these declarations in io.pyi for FileIO. def write(self, b: ReadableBuffer, /) -> int: ... def read(self, size: int = -1, /) -> bytes: ... Shouldn't these return int | None and bytes | None? A FileIO is non-blockin...
Open Graph Description: Typeshed currently has these declarations in io.pyi for FileIO. def write(self, b: ReadableBuffer, /) -> int: ... def read(self, size: int = -1, /) -> bytes: ... Shouldn't these return int | None a...
X Description: Typeshed currently has these declarations in io.pyi for FileIO. def write(self, b: ReadableBuffer, /) -> int: ... def read(self, size: int = -1, /) -> bytes: ... Shouldn't these return in...
Opengraph URL: https://github.com/python/typeshed/issues/12684
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Shouldn't FileIO indicate None as possible return of read/write?","articleBody":"Typeshed currently has these declarations in `io.pyi` for `FileIO`.\r\n\r\n```\r\n def write(self, b: ReadableBuffer, /) -> int: ...\r\n def read(self, size: int = -1, /) -> bytes: ...\r\n```\r\n\r\nShouldn't these return `int | None` and `bytes | None`? A `FileIO` is non-blocking mode can return `None` from these methods, yes?","author":{"url":"https://github.com/dcolascione","@type":"Person","name":"dcolascione"},"datePublished":"2024-09-21T20:48:36Z","url":"https://github.com/python/typeshed/issues/12684"}
| 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:620883e9-d021-daf9-10c5-936b06c68fc6 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B7BE:2D8191:D6DCD4:11E2C1C:6B005308 |
| html-safe-nonce | fc9070eb5c3cf20472e859bae46dbed4ddb1c35c20b9aa654eddacbc577db24a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCN0JFOjJEODE5MTpENkRDRDQ6MTFFMkMxQzo2QjAwNTMwOCIsInZpc2l0b3JfaWQiOiI0MDU3MjE0MDkxNzI1Mzk0Njk2IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 81160127a359c7c09a092a5aa8c0a82f1647b244264cff0df3d6693e0c4cf2ec |
| hovercard-subject-tag | issue:2540504162 |
| 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/12684/issue_layout |
| twitter:image | https://opengraph.githubassets.com/f2bbb949840869b8c81c34591176c778cf234b2c96e5c9ec6743c39c55eef375/python/typeshed/issues/12684 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/f2bbb949840869b8c81c34591176c778cf234b2c96e5c9ec6743c39c55eef375/python/typeshed/issues/12684 |
| og:image:alt | Typeshed currently has these declarations in io.pyi for FileIO. def write(self, b: ReadableBuffer, /) -> int: ... def read(self, size: int = -1, /) -> bytes: ... Shouldn't these return int | None a... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | dcolascione |
| hostname | github.com |
| expected-hostname | github.com |
| None | f420f4996e6b1ff1ccd6d7683f8134f4b5f0f8a50124c210dbfe7490e5644abb |
| 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 | 26e00df917aba0f128135dc073ea0c5e33a70d40 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width