Title: [stubgen] Nested classes in `NamedTuple`s are not produced · Issue #15752 · python/mypy · GitHub
Open Graph Title: [stubgen] Nested classes in `NamedTuple`s are not produced · Issue #15752 · python/mypy
X Title: [stubgen] Nested classes in `NamedTuple`s are not produced · Issue #15752 · python/mypy
Description: Consider this code: from typing import NamedTuple class A(NamedTuple): class B: ... In runtime you can freely access it: >>> from typing import NamedTuple >>> >>> class A(NamedTuple): ... class B: ... ... >>> A.B
Open Graph Description: Consider this code: from typing import NamedTuple class A(NamedTuple): class B: ... In runtime you can freely access it: >>> from typing import NamedTuple >>> >>> class A(NamedTuple): ... class B: ...
X Description: Consider this code: from typing import NamedTuple class A(NamedTuple): class B: ... In runtime you can freely access it: >>> from typing import NamedTuple >>> >>> class A...
Opengraph URL: https://github.com/python/mypy/issues/15752
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[stubgen] Nested classes in `NamedTuple`s are not produced","articleBody":"Consider this code:\r\n\r\n```python\r\nfrom typing import NamedTuple\r\n\r\nclass A(NamedTuple):\r\n class B: ...\r\n```\r\n\r\nIn runtime you can freely access it:\r\n\r\n```python\r\n>>> from typing import NamedTuple\r\n>>> \r\n>>> class A(NamedTuple):\r\n... class B: ...\r\n... \r\n>>> A.B\r\n\u003cclass '__main__.A.B'>\r\n```\r\n\r\nBut, `stubgen` does ignore it:\r\n\r\n```python\r\n» stubgen ex.py && bat out/ex.pyi\r\nProcessed 1 modules\r\nGenerated out/ex.pyi\r\n───────┬───────────────────────────────────────────────────────────────────────────────────\r\n │ File: out/ex.pyi\r\n───────┼───────────────────────────────────────────────────────────────────────────────────\r\n 1 │ from typing import NamedTuple\r\n 2 │ \r\n 3 │ class A(NamedTuple): ...\r\n───────┴───────────────────────────────────────────────────────────────────────────────────\r\n```\r\n\r\nThis needs to be fixed.","author":{"url":"https://github.com/sobolevn","@type":"Person","name":"sobolevn"},"datePublished":"2023-07-23T07:09:58Z","url":"https://github.com/python/mypy/issues/15752"}
| 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:efa9f7a6-1188-3610-e609-7ff5c6438172 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8B98:33DDEF:272C7F9:35CEB09:6B005061 |
| html-safe-nonce | b8ba867d3287bfa05379ae1d0e678b2f009ea450510b10199e429cc3ee995233 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4Qjk4OjMzRERFRjoyNzJDN0Y5OjM1Q0VCMDk6NkIwMDUwNjEiLCJ2aXNpdG9yX2lkIjoiMTcxMzE5NTk4Mjk2MDc0MjQ5NyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 62d1d512db4cde7101944811a95666c11e536fd762253455b3e8201ca4baf513 |
| hovercard-subject-tag | issue:1817018070 |
| 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/15752/issue_layout |
| twitter:image | https://opengraph.githubassets.com/d86a2302b54be13683d60456cd756a942793be616bbbc29275fa87ae7bcc87b0/python/mypy/issues/15752 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/d86a2302b54be13683d60456cd756a942793be616bbbc29275fa87ae7bcc87b0/python/mypy/issues/15752 |
| og:image:alt | Consider this code: from typing import NamedTuple class A(NamedTuple): class B: ... In runtime you can freely access it: >>> from typing import NamedTuple >>> >>> class A(NamedTuple): ... class B: ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | sobolevn |
| hostname | github.com |
| expected-hostname | github.com |
| None | f420f4996e6b1ff1ccd6d7683f8134f4b5f0f8a50124c210dbfe7490e5644abb |
| 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 | 26e00df917aba0f128135dc073ea0c5e33a70d40 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width