Title: Weird `n_fields` attributes, etc. · Issue #6546 · python/typeshed · GitHub
Open Graph Title: Weird `n_fields` attributes, etc. · Issue #6546 · python/typeshed
X Title: Weird `n_fields` attributes, etc. · Issue #6546 · python/typeshed
Description: There are a bunch of NamedTuple-like classes in some of the stranger corners of the stdlib that have the following three attributes: n_fields n_sequence_fields n_unnamed_fields For example: typeshed/tests/stubtest_allowlists/py3_common.t...
Open Graph Description: There are a bunch of NamedTuple-like classes in some of the stranger corners of the stdlib that have the following three attributes: n_fields n_sequence_fields n_unnamed_fields For example: typeshe...
X Description: There are a bunch of NamedTuple-like classes in some of the stranger corners of the stdlib that have the following three attributes: n_fields n_sequence_fields n_unnamed_fields For example: typeshe...
Opengraph URL: https://github.com/python/typeshed/issues/6546
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Weird `n_fields` attributes, etc.","articleBody":"There are a bunch of `NamedTuple`-like classes in some of the stranger corners of the stdlib that have the following three attributes:\r\n\r\n- `n_fields`\r\n- `n_sequence_fields`\r\n- `n_unnamed_fields`\r\n\r\nFor example:\r\n\r\nhttps://github.com/python/typeshed/blob/1fdd7e40afbad567a92de4ce98bdddaa6be14db5/tests/stubtest_allowlists/py3_common.txt#L620-L631\r\n\r\n@Akuli [counts 22 classes](https://github.com/python/typeshed/pull/6500#discussion_r762599896) that are missing these attributes. Some classes, however, _do_ currently define these attributes in the stub currently. `time._struct_time` defines them as properties (which seems incorrect -- they seem more like `ClassVar`s to me):\r\n\r\nhttps://github.com/python/typeshed/blob/1fdd7e40afbad567a92de4ce98bdddaa6be14db5/stdlib/time.pyi#L35-L50\r\n\r\nAs discussed [here](https://github.com/python/typeshed/pull/6500#discussion_r762599896), these attributes don't seem particularly _useful_. I'm also not sure there's much _harm_ in having them in the stubs, but it might be weird to have them popping up in autocompletion suggestions.\r\n\r\nIn any event, they should probably either all be added to the stubs, or all removed from stubs, and added to the \"wontfix\" section of the allowlists instead of the \"missing from stubs\" section of the allowlists.\r\n\r\nThoughts?","author":{"url":"https://github.com/AlexWaygood","@type":"Person","name":"AlexWaygood"},"datePublished":"2021-12-08T13:36:06Z","url":"https://github.com/python/typeshed/issues/6546"}
| 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:6bf561d8-3033-a21a-0232-e09fa7a27f0b |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | DA04:390AA2:27A1BA5:361204B:6B0042D8 |
| html-safe-nonce | f228179edbef5be369f442b8ada4349fda38e2e62a4ea38177eb68d536b491ea |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEQTA0OjM5MEFBMjoyN0ExQkE1OjM2MTIwNEI6NkIwMDQyRDgiLCJ2aXNpdG9yX2lkIjoiMjkxNTcxNDAxNzU1NTEzNzI0MCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 17c0a854bf0b7fd365e27622a7f91ce45bd525ca8dbb66c4785cd29579815b88 |
| hovercard-subject-tag | issue:1074419754 |
| 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/typeshed/6546/issue_layout |
| twitter:image | https://opengraph.githubassets.com/cc49f10b8f393b1ff1cd6d677e6007f0e3c7db67bb371de5cec637a63c73b640/python/typeshed/issues/6546 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/cc49f10b8f393b1ff1cd6d677e6007f0e3c7db67bb371de5cec637a63c73b640/python/typeshed/issues/6546 |
| og:image:alt | There are a bunch of NamedTuple-like classes in some of the stranger corners of the stdlib that have the following three attributes: n_fields n_sequence_fields n_unnamed_fields For example: typeshe... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | AlexWaygood |
| hostname | github.com |
| expected-hostname | github.com |
| None | 7d0829bbde9e48b2486cb5dd6d147896eb01d32134627091f818958a935ef3f0 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/typeshed git https://github.com/python/typeshed.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 31696383 |
| octolytics-dimension-repository_nwo | python/typeshed |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 31696383 |
| octolytics-dimension-repository_network_root_nwo | python/typeshed |
| 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 | f3f3a43ca095cdea3abbb394112e971f9fdb94fa |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width