Title: Unexpected error behaviour: Parameterized generics cannot be used with class or instance checks · Issue #12155 · python/mypy · GitHub
Open Graph Title: Unexpected error behaviour: Parameterized generics cannot be used with class or instance checks · Issue #12155 · python/mypy
X Title: Unexpected error behaviour: Parameterized generics cannot be used with class or instance checks · Issue #12155 · python/mypy
Description: mypy reports success for import numpy as np x = "a" assert isinstance(x, np.float64) but fails for from numpy import float64 x = "a" assert isinstance(x, float64) with the error fails.py:3: error: Parameterized generics cannot be used wi...
Open Graph Description: mypy reports success for import numpy as np x = "a" assert isinstance(x, np.float64) but fails for from numpy import float64 x = "a" assert isinstance(x, float64) with the error fails.py:3: error: ...
X Description: mypy reports success for import numpy as np x = "a" assert isinstance(x, np.float64) but fails for from numpy import float64 x = "a" assert isinstance(x, float64) with the error...
Opengraph URL: https://github.com/python/mypy/issues/12155
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Unexpected error behaviour: Parameterized generics cannot be used with class or instance checks","articleBody":"`mypy` reports success for\r\n```python \r\nimport numpy as np\r\nx = \"a\"\r\nassert isinstance(x, np.float64)\r\n```\r\nbut fails for\r\n```python\r\nfrom numpy import float64\r\nx = \"a\"\r\nassert isinstance(x, float64)\r\n\r\n```\r\nwith the error `fails.py:3: error: Parameterized generics cannot be used with class or instance checks`\r\n\r\nI'm using `mypy` (0.931) and `numpy` (1.22.2).\r\n\r\nWhy do I get different results?","author":{"url":"https://github.com/JohanSchott","@type":"Person","name":"JohanSchott"},"datePublished":"2022-02-09T11:32:22Z","url":"https://github.com/python/mypy/issues/12155"}
| 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:69acb065-9ea3-6828-d4aa-af795bde3152 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BB78:3A438:26F776:366F00:6B006A4B |
| html-safe-nonce | 03331dc76a72e85b71d15d9c9218071bbe5917ba7ebf192c4936574748a66b50 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCQjc4OjNBNDM4OjI2Rjc3NjozNjZGMDA6NkIwMDZBNEIiLCJ2aXNpdG9yX2lkIjoiNTEzODA5MjM5OTAyNDY5NTg4MyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 137e22b9eac9599799bfc7805aa12c3202cf6ecd2ad279c7437ad086ac7a4a97 |
| hovercard-subject-tag | issue:1128420797 |
| 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/12155/issue_layout |
| twitter:image | https://opengraph.githubassets.com/2b452c99c87315f2a2573b39d38a4a445011153fe9270d57afe378def33eb330/python/mypy/issues/12155 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/2b452c99c87315f2a2573b39d38a4a445011153fe9270d57afe378def33eb330/python/mypy/issues/12155 |
| og:image:alt | mypy reports success for import numpy as np x = "a" assert isinstance(x, np.float64) but fails for from numpy import float64 x = "a" assert isinstance(x, float64) with the error fails.py:3: error: ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | JohanSchott |
| hostname | github.com |
| expected-hostname | github.com |
| None | 6527e91c60c0b29d16606ff32ac5df8ecdc37a2a62205ea057a14d7762c870fa |
| 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 | 46f1cd2ae3cd8ae1a81019b5d619742e76f13bbd |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width