Title: `isinstance(x, CallableType) and x.is_type_object()` is a code smell · Issue #12320 · python/mypy · GitHub
Open Graph Title: `isinstance(x, CallableType) and x.is_type_object()` is a code smell · Issue #12320 · python/mypy
X Title: `isinstance(x, CallableType) and x.is_type_object()` is a code smell · Issue #12320 · python/mypy
Description: While fixing #12319 I noticed that if you grep for is_type_object, there are several instances where only CallableTypes are handled. Presumably, these all do the wrong thing for types with overloaded __new__.
Open Graph Description: While fixing #12319 I noticed that if you grep for is_type_object, there are several instances where only CallableTypes are handled. Presumably, these all do the wrong thing for types with overload...
X Description: While fixing #12319 I noticed that if you grep for is_type_object, there are several instances where only CallableTypes are handled. Presumably, these all do the wrong thing for types with overload...
Opengraph URL: https://github.com/python/mypy/issues/12320
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"`isinstance(x, CallableType) and x.is_type_object()` is a code smell","articleBody":"While fixing https://github.com/python/mypy/pull/12319 I noticed that if you grep for `is_type_object`, there are several instances where only CallableTypes are handled. Presumably, these all do the wrong thing for types with overloaded `__new__`.","author":{"url":"https://github.com/hauntsaninja","@type":"Person","name":"hauntsaninja"},"datePublished":"2022-03-09T07:27:56.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/12320/mypy/issues/12320"}
| 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:76ca3c3f-8ad9-2df7-ccbc-c4a74f709f38 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8B02:265E5B:3D27C01:5371E4C:6A5DF286 |
| html-safe-nonce | 698434f38d06d0117a8d2d1dbc35bc2ad2f02626209b122ebab178f4841a5cb9 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4QjAyOjI2NUU1QjozRDI3QzAxOjUzNzFFNEM6NkE1REYyODYiLCJ2aXNpdG9yX2lkIjoiNzE1OTcwMjgwNDgxNTAxNjU4MiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | b32439c5a49038d6f98744a35fdccc1175e515bf9ded437e45379ce541e9f181 |
| hovercard-subject-tag | issue:1163584298 |
| 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/12320/issue_layout |
| twitter:image | https://opengraph.githubassets.com/dd5a5d59fb32f1b0e2e02b82cfdd4d561072c2e27849afb9329f37c547be34f2/python/mypy/issues/12320 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/dd5a5d59fb32f1b0e2e02b82cfdd4d561072c2e27849afb9329f37c547be34f2/python/mypy/issues/12320 |
| og:image:alt | While fixing #12319 I noticed that if you grep for is_type_object, there are several instances where only CallableTypes are handled. Presumably, these all do the wrong thing for types with overload... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | hauntsaninja |
| hostname | github.com |
| expected-hostname | github.com |
| None | 7f8603048a7a8270fc5b845c28ec71e80a9a899268387bcf65814ee1b51c0cc4 |
| 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 | e2a5561aeb049d0632a92906af784af5d414c603 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width