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:976a280e-7071-cfd4-4795-c4e0275c0c40 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BCDC:11682C:8A46978:BC93CAE:6A5E9A4D |
| html-safe-nonce | 028b9614c8854e117c47a45a778c14eb8a52d2da7a988661e68c5df6f13ffd96 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCQ0RDOjExNjgyQzo4QTQ2OTc4OkJDOTNDQUU6NkE1RTlBNEQiLCJ2aXNpdG9yX2lkIjoiNjE3MDc5NjQ5NzY5NTU3ODcwMSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 12377eff802febe76a6705609d296b5e851d373ecd087ac617ecacd327aa1615 |
| 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 | 7c7e31acb6a895494e518b880f5ccf39604f7fa9a8f2f3c64145efc3b776256d |
| 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 | 2d2ac9bdd71d5f53f2b731c9330677e38624e301 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width