Title: `ctypes.Array` should be abstract · Issue #6349 · python/typeshed · GitHub
Open Graph Title: `ctypes.Array` should be abstract · Issue #6349 · python/typeshed
X Title: `ctypes.Array` should be abstract · Issue #6349 · python/typeshed
Description: Right now Array in ctypes is a regular class: typeshed/stdlib/ctypes/__init__.pyi Lines 269 to 271 in 5c8e68f class Array(Generic[_CT], _CData): _length_: ClassVar[int] But, in reallity - you cannot instantiate it: >>> from ctypes import...
Open Graph Description: Right now Array in ctypes is a regular class: typeshed/stdlib/ctypes/__init__.pyi Lines 269 to 271 in 5c8e68f class Array(Generic[_CT], _CData): _length_: ClassVar[int] But, in reallity - you canno...
X Description: Right now Array in ctypes is a regular class: typeshed/stdlib/ctypes/__init__.pyi Lines 269 to 271 in 5c8e68f class Array(Generic[_CT], _CData): _length_: ClassVar[int] But, in reallity - you canno...
Opengraph URL: https://github.com/python/typeshed/issues/6349
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"`ctypes.Array` should be abstract","articleBody":"Right now `Array` in `ctypes` is a regular class: \r\n\r\nhttps://github.com/python/typeshed/blob/5c8e68f0ebeb0528790c0a13fda3131d6434cda7/stdlib/ctypes/__init__.pyi#L269-L271\r\n\r\nBut, in reallity - you cannot instantiate it: \r\n\r\n```python\r\n>>> from ctypes import Array, c_int\r\n>>> i = c_int(1)\r\n>>> Array(i)\r\nTraceback (most recent call last):\r\n File \"\u003cstdin>\", line 1, in \u003cmodule>\r\nTypeError: abstract class\r\n```\r\n\r\nMypy is also not happy with `Array(...)` but for other reasons:\r\n\r\n```\r\nout/ex.py:4: error: Array constructor argument 1 of type \"c_int\" is not convertible to the array element type \u003cnothing>\r\nout/ex.py:4: note: Revealed type is \"ctypes.Array[\u003cnothing>]\"\r\n```\r\n\r\n`Array(...)` is not tested in https://github.com/python/mypy/blob/master/test-data/unit/check-ctypes.test at all","author":{"url":"https://github.com/sobolevn","@type":"Person","name":"sobolevn"},"datePublished":"2021-11-20T09:11:23Z","url":"https://github.com/python/typeshed/issues/6349"}
| 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:6b1677b1-84d2-7895-2ee3-a6898c987d4e |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E77E:37BEAD:22325EE:2E9DAE6:6B00292E |
| html-safe-nonce | f6d13091e4930620a37a74c94b600a81b076aefcfc8682f1e8c1c4d4ac4e33d1 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNzdFOjM3QkVBRDoyMjMyNUVFOjJFOURBRTY6NkIwMDI5MkUiLCJ2aXNpdG9yX2lkIjoiODk3ODUxNTE1ODUzNjAzODcwMiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | ee0bf68e96efecfa381d5da07c3cba26949eba2394dcff5763a0936aedd43c6b |
| hovercard-subject-tag | issue:1059101134 |
| 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/6349/issue_layout |
| twitter:image | https://opengraph.githubassets.com/e148889fad2cdf937cfe2e3dde22aac66ea1fe9ba271aa59803b65d493f4198b/python/typeshed/issues/6349 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/e148889fad2cdf937cfe2e3dde22aac66ea1fe9ba271aa59803b65d493f4198b/python/typeshed/issues/6349 |
| og:image:alt | Right now Array in ctypes is a regular class: typeshed/stdlib/ctypes/__init__.pyi Lines 269 to 271 in 5c8e68f class Array(Generic[_CT], _CData): _length_: ClassVar[int] But, in reallity - you canno... |
| 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 | 4eb4cba0d69f045374ac15de9666d22b0961e1d555cc3824f36b7734c00c78e0 |
| 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 | 44c658b24abf00491fb7ae5f56d42c9f38cbeab2 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width