Title: @sys.meta_path.append type error · Issue #5589 · python/mypy · GitHub
Open Graph Title: @sys.meta_path.append type error · Issue #5589 · python/mypy
X Title: @sys.meta_path.append type error · Issue #5589 · python/mypy
Description: I'm not sure if this is a bug in Python or in mypy, or there is no bug at all. It seems a bit weird given the contents of sys.meta_path and my grep-fu must suck because I can't find where the signature is defined. Here's the code: import...
Open Graph Description: I'm not sure if this is a bug in Python or in mypy, or there is no bug at all. It seems a bit weird given the contents of sys.meta_path and my grep-fu must suck because I can't find where the signa...
X Description: I'm not sure if this is a bug in Python or in mypy, or there is no bug at all. It seems a bit weird given the contents of sys.meta_path and my grep-fu must suck because I can't find where t...
Opengraph URL: https://github.com/python/mypy/issues/5589
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"@sys.meta_path.append type error","articleBody":"I'm not sure if this is a bug in Python or in mypy, or there is no bug at all. It seems a bit weird given the contents of `sys.meta_path` and my grep-fu must suck because I can't find where the signature is defined. Here's the code:\r\n\r\n```python\r\nimport sys\r\n\r\n\r\n@sys.meta_path.append\r\nclass LostFinder:\r\n @staticmethod\r\n def find_spec(*args, **kws):\r\n return None\r\n```\r\n\r\nand the error:\r\n\r\n```bash\r\n$ mypy foo.py \r\nfoo.py:4: error: Argument 1 to \"append\" of \"list\" has incompatible type \"Type[LostFinder]\"; expected \"MetaPathFinder\"\r\n```\r\n\r\nand the contents of `sys.meta_path` on a vanilla Python:\r\n\r\n```bash\r\n$ python3.7 -I -c \"import sys; print(sys.meta_path)\"\r\n[\u003cclass '_frozen_importlib.BuiltinImporter'>, \u003cclass '_frozen_importlib.FrozenImporter'>, \u003cclass '_frozen_importlib_external.PathFinder'>]\r\n```","author":{"url":"https://github.com/warsaw","@type":"Person","name":"warsaw"},"datePublished":"2018-09-07T21:41:12Z","url":"https://github.com/python/mypy/issues/5589"}
| 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:b78a30ac-be76-edd4-a9ea-5877313d5494 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A4C0:213839:BEB951:F747A4:6B00ED03 |
| html-safe-nonce | cde8afc1767262c09cbcecf9d964999105207e12c2db45517bdcd564871441c1 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNEMwOjIxMzgzOTpCRUI5NTE6Rjc0N0E0OjZCMDBFRDAzIiwidmlzaXRvcl9pZCI6IjIxNjMxOTAwNjE3Mjg4NTMyNTIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 2df7bca747b993403e00dfe4adc134a3f1d8f466214f5ba93b5e598e80e8cfc9 |
| hovercard-subject-tag | issue:358219957 |
| 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/mypy/5589/issue_layout |
| twitter:image | https://opengraph.githubassets.com/17a68873fca9166633a8890e6551d1c407ad68ddf9b31761e120ec47fbe4cced/python/mypy/issues/5589 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/17a68873fca9166633a8890e6551d1c407ad68ddf9b31761e120ec47fbe4cced/python/mypy/issues/5589 |
| og:image:alt | I'm not sure if this is a bug in Python or in mypy, or there is no bug at all. It seems a bit weird given the contents of sys.meta_path and my grep-fu must suck because I can't find where the signa... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | warsaw |
| hostname | github.com |
| expected-hostname | github.com |
| None | 4ef498cbabcbe3c50befc7a5b743e7072ee770b4daf0e15e54801180d1fa91fc |
| turbo-cache-control | no-preview |
| go-import | github.com/python/mypy git https://github.com/python/mypy.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 7053637 |
| octolytics-dimension-repository_nwo | python/mypy |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 7053637 |
| octolytics-dimension-repository_network_root_nwo | python/mypy |
| 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 | 9983dd5da06943f833c971dd5b6bc988e2858be5 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width