Title: migrate some stuffs in `ctypes/__init__.pyi` into `_ctypes.pyi`, but circular import occurs · Issue #8633 · python/typeshed · GitHub
Open Graph Title: migrate some stuffs in `ctypes/__init__.pyi` into `_ctypes.pyi`, but circular import occurs · Issue #8633 · python/typeshed
X Title: migrate some stuffs in `ctypes/__init__.pyi` into `_ctypes.pyi`, but circular import occurs · Issue #8633 · python/typeshed
Description: When we submitted PR that adds the stdlib/_ctypes.pyi(#8582), imports some stuffs from ctypes. But the implementation imports some stuffs from _ctypes to ctypes. also related to #8571 (comment) However, trying to write type stubs as clos...
Open Graph Description: When we submitted PR that adds the stdlib/_ctypes.pyi(#8582), imports some stuffs from ctypes. But the implementation imports some stuffs from _ctypes to ctypes. also related to #8571 (comment) How...
X Description: When we submitted PR that adds the stdlib/_ctypes.pyi(#8582), imports some stuffs from ctypes. But the implementation imports some stuffs from _ctypes to ctypes. also related to #8571 (comment) How...
Opengraph URL: https://github.com/python/typeshed/issues/8633
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"migrate some stuffs in `ctypes/__init__.pyi` into `_ctypes.pyi`, but circular import occurs","articleBody":"When we submitted PR that adds the `stdlib/_ctypes.pyi`(#8582), imports some stuffs from `ctypes`.\r\n\r\nBut [the implementation imports some stuffs from `_ctypes` to `ctypes`](https://github.com/python/cpython/blob/0ace820bec8892d621a4aadc1feb6c56e25560bf/Lib/ctypes/__init__.py#L8-L14).\r\n- also related to https://github.com/python/typeshed/issues/8571#issuecomment-1221316973\r\n\r\nHowever, trying to write type stubs as close as possible to the implementation would result in circular imports if we just move definitions around.\r\n- For example, `CDLL` in args of `_CData` methods.\r\n - In implementation... \r\n - `CDLLL` is defined in `ctypes`\r\n - `_CData`(base class of `_SimpleCData`) is defined in `_ctypes`.\r\n- Some PRs, such as #5350, were merged as \"should be fine in `pyi` files\" even if they are circular imports.\r\n\r\nAny opinions would be appreciated.","author":{"url":"https://github.com/junkmd","@type":"Person","name":"junkmd"},"datePublished":"2022-08-27T11:30:37.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":10},"url":"https://github.com/8633/typeshed/issues/8633"}
| 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:8503014b-163a-1d7f-6c69-3648ffd7062f |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | CD90:6E104:4C963:6D685:6A61F769 |
| html-safe-nonce | 8bf13bcf5692c76266d3b8b1a48441e560ad566687604d300d6011699fc2d72f |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDRDkwOjZFMTA0OjRDOTYzOjZENjg1OjZBNjFGNzY5IiwidmlzaXRvcl9pZCI6Ijg3NTA3MzkxNDAwMDk2NTQxMjEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | f6c38c82bc12b82317fc94af72cb9f6ea425fb320b7b386764c4e81dd89d8087 |
| hovercard-subject-tag | issue:1353020993 |
| 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/8633/issue_layout |
| twitter:image | https://opengraph.githubassets.com/e03347b32a1560ec530fdde7118a946d7b105d4cafaa032a4989c885f9266cf6/python/typeshed/issues/8633 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/e03347b32a1560ec530fdde7118a946d7b105d4cafaa032a4989c885f9266cf6/python/typeshed/issues/8633 |
| og:image:alt | When we submitted PR that adds the stdlib/_ctypes.pyi(#8582), imports some stuffs from ctypes. But the implementation imports some stuffs from _ctypes to ctypes. also related to #8571 (comment) How... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | junkmd |
| hostname | github.com |
| expected-hostname | github.com |
| None | d88d9dd41cd32712dc23ff01ba406271c88c4858198430c255d591be42a1166f |
| 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 | a7f024eda6b8ce06d29c9276168423bfe05bafae |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width