Title: 'gzip.GzipFile' appears to be missing 'IO[...]' · Issue #2580 · python/typeshed · GitHub
Open Graph Title: 'gzip.GzipFile' appears to be missing 'IO[...]' · Issue #2580 · python/typeshed
X Title: 'gzip.GzipFile' appears to be missing 'IO[...]' · Issue #2580 · python/typeshed
Description: I'm not sure if this is a bug in MyPy or the typeshed, however tryngi to use a gzip.GzipFile where a file should be produces an error: test.py import gzip, typing def my_test_writer(file: typing.IO[bytes]) : ... my_test_writer(gzip.GzipF...
Open Graph Description: I'm not sure if this is a bug in MyPy or the typeshed, however tryngi to use a gzip.GzipFile where a file should be produces an error: test.py import gzip, typing def my_test_writer(file: typing.IO...
X Description: I'm not sure if this is a bug in MyPy or the typeshed, however tryngi to use a gzip.GzipFile where a file should be produces an error: test.py import gzip, typing def my_test_writer(file: typin...
Opengraph URL: https://github.com/python/typeshed/issues/2580
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"'gzip.GzipFile' appears to be missing 'IO[...]'","articleBody":"I'm not sure if this is a bug in MyPy or the typeshed, however tryngi to use a `gzip.GzipFile` where a file should be produces an error:\r\n\r\ntest.py\r\n```\r\nimport gzip, typing\r\ndef my_test_writer(file: typing.IO[bytes]) : ...\r\nmy_test_writer(gzip.GzipFile(\"rb\"))\r\n```\r\nRunning `mypy test.py` (I ran from `/tmp` to ensure no config files were causing problems) gives:\r\n```\r\ntest.py:4: error: Argument 1 to \"my_test_writer\" has incompatible type \"GzipFile\"; expected \"IO[bytes]\"\r\n```\r\n","author":{"url":"https://github.com/software-opal","@type":"Person","name":"software-opal"},"datePublished":"2018-11-02T12:38:34Z","url":"https://github.com/python/typeshed/issues/2580"}
| 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:d76cb2fe-bd77-7e63-8931-30e9cbd7bb67 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BC22:B5253:153AB6C:1C08264:6B0019FC |
| html-safe-nonce | a4901f492a1d6545beae6616e470520e792e34d985a6c044511fd2281e25b43a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCQzIyOkI1MjUzOjE1M0FCNkM6MUMwODI2NDo2QjAwMTlGQyIsInZpc2l0b3JfaWQiOiI0MDQwOTkwODAxOTUyNTEyNTA4IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | d5f91893a1cabd869f47519bd7d96903c36532d881ed2d5a9201bc31842bc83b |
| hovercard-subject-tag | issue:376793487 |
| 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/2580/issue_layout |
| twitter:image | https://opengraph.githubassets.com/28ba4f3d79d0e2c360af4fc06f562c354083351fc1484f27970a3a99740c2197/python/typeshed/issues/2580 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/28ba4f3d79d0e2c360af4fc06f562c354083351fc1484f27970a3a99740c2197/python/typeshed/issues/2580 |
| og:image:alt | I'm not sure if this is a bug in MyPy or the typeshed, however tryngi to use a gzip.GzipFile where a file should be produces an error: test.py import gzip, typing def my_test_writer(file: typing.IO... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | software-opal |
| hostname | github.com |
| expected-hostname | github.com |
| None | a2dd2291b1b13cc9c06f27ec92fa3dbaf34116fc24c9347b8539db61884c59f4 |
| 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 | 70121d4e855ee0bb7b75cf15d061d91f8863c0f8 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width