Title: Issue with ctypes Structure.from_buffer_copy class method · Issue #10777 · python/typeshed · GitHub
Open Graph Title: Issue with ctypes Structure.from_buffer_copy class method · Issue #10777 · python/typeshed
X Title: Issue with ctypes Structure.from_buffer_copy class method · Issue #10777 · python/typeshed
Description: I was getting ready to submit this against pyright but happened across this report there which brought me here since it seems to be the same sort of problem. microsoft/pyright#5932 And related to this typeshed issue. #10567 When calling ...
Open Graph Description: I was getting ready to submit this against pyright but happened across this report there which brought me here since it seems to be the same sort of problem. microsoft/pyright#5932 And related to t...
X Description: I was getting ready to submit this against pyright but happened across this report there which brought me here since it seems to be the same sort of problem. microsoft/pyright#5932 And related to t...
Opengraph URL: https://github.com/python/typeshed/issues/10777
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Issue with ctypes Structure.from_buffer_copy class method","articleBody":"I was getting ready to submit this against pyright but happened across this report there which brought me here since it seems to be the same sort of problem.\r\nhttps://github.com/microsoft/pyright/issues/5932\r\n\r\nAnd related to this typeshed issue.\r\nhttps://github.com/python/typeshed/issues/10567\r\n\r\nWhen calling the from_buffer_copy class method on a ctypes structure an error is reported indicating it is not callable when it should be (when calling it on an instance of the structure its fine and shouldnt be?).\r\n\r\n```python\r\nimport ctypes\r\n\r\nclass SomeStructure(ctypes.Structure):\r\n _fields_ = [\r\n ('field0', ctypes.c_uint32),\r\n ('field1', ctypes.c_uint32),\r\n ('field2', ctypes.c_uint32),\r\n ('field3', ctypes.c_uint32),\r\n ]\r\n\r\nSomeStructure.from_buffer_copy(bytes([0]*16)) # error, should be ok Object of type \"_CField[Any, Any, Any]\" is not callable\r\n\r\nSomeStructure(0,0,0,0).from_buffer_copy(bytes([0]*16)) # ok, should be an error/fails at runtime?\r\n\r\n# And for some reason this works (and it should).\r\nSomeStructureArray = SomeStructure*10\r\nSomeStructureArray.from_buffer_copy(bytes([0]*160)) # is okay and should be okay\r\n```\r\n\r\n**VS Code extension or command-line**\r\npyright version: 1.1.328","author":{"url":"https://github.com/eehusky","@type":"Person","name":"eehusky"},"datePublished":"2023-09-25T21:06:56Z","url":"https://github.com/python/typeshed/issues/10777"}
| 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:88399503-c5d8-5aa5-1873-478e278eaddf |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 803A:1BAA33:20D0EB4:2B98DAC:6B00471A |
| html-safe-nonce | d1813e3cd13063c986ab502d3fc46081ccd484f99bb2d8eada1cc0ea0338399d |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4MDNBOjFCQUEzMzoyMEQwRUI0OjJCOThEQUM6NkIwMDQ3MUEiLCJ2aXNpdG9yX2lkIjoiOTgwMDMzNDI5NDQzODg4OTAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 3555039170dbe663081b016005682d0a6540ff12b9effc8732dd9a044542e962 |
| hovercard-subject-tag | issue:1912283631 |
| 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/10777/issue_layout |
| twitter:image | https://opengraph.githubassets.com/64df240443a5509b9df21f4d8efdfdf21d27fd4e325b4e4209d8b81e26fa0c48/python/typeshed/issues/10777 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/64df240443a5509b9df21f4d8efdfdf21d27fd4e325b4e4209d8b81e26fa0c48/python/typeshed/issues/10777 |
| og:image:alt | I was getting ready to submit this against pyright but happened across this report there which brought me here since it seems to be the same sort of problem. microsoft/pyright#5932 And related to t... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | eehusky |
| 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