Title: self.__class__.__name__ has type Any in class derived from Any · Issue #4058 · python/mypy · GitHub
Open Graph Title: self.__class__.__name__ has type Any in class derived from Any · Issue #4058 · python/mypy
X Title: self.__class__.__name__ has type Any in class derived from Any · Issue #4058 · python/mypy
Description: Here's something that came up in python/typeshed#1549 (comment). from typing import Any, Type, TypeVar T = TypeVar('T') class C(Any): def bar(self: T) -> Type[T]: ... def foo(self) -> None: reveal_type(self.bar()) # Type[C], as expected ...
Open Graph Description: Here's something that came up in python/typeshed#1549 (comment). from typing import Any, Type, TypeVar T = TypeVar('T') class C(Any): def bar(self: T) -> Type[T]: ... def foo(self) -> None: reveal_...
X Description: Here's something that came up in python/typeshed#1549 (comment). from typing import Any, Type, TypeVar T = TypeVar('T') class C(Any): def bar(self: T) -> Type[T]: ... def foo(self) -...
Opengraph URL: https://github.com/python/mypy/issues/4058
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"self.__class__.__name__ has type Any in class derived from Any","articleBody":"Here's something that came up in https://github.com/python/typeshed/pull/1549#issuecomment-333227407.\r\n```py\r\nfrom typing import Any, Type, TypeVar\r\nT = TypeVar('T')\r\nclass C(Any):\r\n def bar(self: T) -> Type[T]: ...\r\n def foo(self) -> None:\r\n reveal_type(self.bar()) # Type[C], as expected\r\n reveal_type(self.bar().__name__) # Any, but expected str\r\n```\r\n@ilevkivskyi I think you muttered something about `analyze_member_access` for `TypeType` still being broken but I'm not sure I understand.","author":{"url":"https://github.com/gvanrossum","@type":"Person","name":"gvanrossum"},"datePublished":"2017-10-04T21:02:07Z","url":"https://github.com/python/mypy/issues/4058"}
| 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:0c7d801f-07b7-4af7-57ed-dfbb84603069 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 93F4:5537E:14D4CA0:1B5ACE3:6B000CBE |
| html-safe-nonce | 412f8b418365e15866f836924c17d92ed9eb745d7b8021191ab7520083c97a36 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5M0Y0OjU1MzdFOjE0RDRDQTA6MUI1QUNFMzo2QjAwMENCRSIsInZpc2l0b3JfaWQiOiI3Nzc0OTYwNTE2NDA0ODc0NDMwIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 8a04c8d69156176d416fb67cc3f38779397d2606cd4be07296bd048d10aa3f94 |
| hovercard-subject-tag | issue:262929467 |
| 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/4058/issue_layout |
| twitter:image | https://opengraph.githubassets.com/01ed02f01a363d6dd6a3c585a6062057202b1c62675052fb251f641104bb309c/python/mypy/issues/4058 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/01ed02f01a363d6dd6a3c585a6062057202b1c62675052fb251f641104bb309c/python/mypy/issues/4058 |
| og:image:alt | Here's something that came up in python/typeshed#1549 (comment). from typing import Any, Type, TypeVar T = TypeVar('T') class C(Any): def bar(self: T) -> Type[T]: ... def foo(self) -> None: reveal_... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | gvanrossum |
| hostname | github.com |
| expected-hostname | github.com |
| None | cf7ee0062053ad9eb05b6e5de57bd96c2055708bcbada4144946b5ec129cf1d7 |
| 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 | 9cab7de176a56362d2aabcbb4d1e07e846eba8a0 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width