Title: Allow docstrings in Python 3.6+ class based TypedDict · Issue #3747 · python/mypy · GitHub
Open Graph Title: Allow docstrings in Python 3.6+ class based TypedDict · Issue #3747 · python/mypy
X Title: Allow docstrings in Python 3.6+ class based TypedDict · Issue #3747 · python/mypy
Description: At the moment, if you try to define the following type, from mypy_extensions import TypedDict class GroupJSON(TypedDict): """ JSON representation of group, received from API-endpoint """ group_name: str you end up receiving an mypy error...
Open Graph Description: At the moment, if you try to define the following type, from mypy_extensions import TypedDict class GroupJSON(TypedDict): """ JSON representation of group, received from API-endpoint """ group_name...
X Description: At the moment, if you try to define the following type, from mypy_extensions import TypedDict class GroupJSON(TypedDict): """ JSON representation of group, received from API-endpoint...
Opengraph URL: https://github.com/python/mypy/issues/3747
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Allow docstrings in Python 3.6+ class based TypedDict","articleBody":"At the moment, if you try to define the following type,\r\n```python\r\nfrom mypy_extensions import TypedDict\r\n\r\nclass GroupJSON(TypedDict):\r\n \"\"\" JSON representation of group, received from API-endpoint \"\"\"\r\n group_name: str\r\n```\r\nyou end up receiving an mypy error saying something along the lines of `expected format 'key_name: value_type'`. Excuse me for not providing the exact error message, as I won't be able to use a computer for a couple of days.\r\n\r\nIt can be avoided by using the normal `#`-comment syntax. It still came as a surprise when using this syntax. Most people are probably used to documenting classes with docstrings. \r\n\r\nPerhaps this behaviour is intentional, as `TypedDict` instances are interpreted as normal dictionaries at runtime? I would still argue that this is an implementation detail leaking through to the interface. Perhaps the docstring can be entirely ignored at runtime?\r\n\r\nThanks in advance,\r\nJakob","author":{"url":"https://github.com/JakobGM","@type":"Person","name":"JakobGM"},"datePublished":"2017-07-20T12:53:00Z","url":"https://github.com/python/mypy/issues/3747"}
| 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:5cb7f660-38ed-56e1-52c5-19faa18f99c4 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D15C:356FBF:22C3286:2F0DCBF:6B002415 |
| html-safe-nonce | 1047253397ea901cedd98b6f5e184417278dda5f46dc77c1afc0769c3c808a1a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMTVDOjM1NkZCRjoyMkMzMjg2OjJGMERDQkY6NkIwMDI0MTUiLCJ2aXNpdG9yX2lkIjoiOTQ4NjE2MDg4Mjk0MjY5OTczIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | bf643af471e0ae789ba88c248630d8b4bf027493165fa3ed8350c5ed9d4b7f41 |
| hovercard-subject-tag | issue:244351255 |
| 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/3747/issue_layout |
| twitter:image | https://opengraph.githubassets.com/0ea52bc7be6f1618e9e5aeac3ef9ac45c10ea9d6054656d5e71ecba63cfc30df/python/mypy/issues/3747 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/0ea52bc7be6f1618e9e5aeac3ef9ac45c10ea9d6054656d5e71ecba63cfc30df/python/mypy/issues/3747 |
| og:image:alt | At the moment, if you try to define the following type, from mypy_extensions import TypedDict class GroupJSON(TypedDict): """ JSON representation of group, received from API-endpoint """ group_name... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | JakobGM |
| hostname | github.com |
| expected-hostname | github.com |
| None | 4eb4cba0d69f045374ac15de9666d22b0961e1d555cc3824f36b7734c00c78e0 |
| 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 | 44c658b24abf00491fb7ae5f56d42c9f38cbeab2 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width