FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-104533: Use @ctypes.util.struct decorator by vstinner · Pull Request #154031 · python/cpython · GitHub

Repository navigation

gh-104533: Use @ctypes.util.struct decorator - #154031

Merged
vstinner merged 10 commits into
python:mainfrom
vstinner:ctypes_struct
Jul 19, 2026
Merged

vstinner merged 10 commits into
python:mainfrom
vstinner:ctypes_struct

Conversation

vstinner commented Jul 18, 2026 •
edited by bedevere-app Bot
Loading

Copy link
Copy Markdown
Member

Use also @ctypes.util.wrap_dll_function() decorator.

Use also @ctypes.util.wrap_dll_function() decorator.

Copy link
Copy Markdown
Member Author

Oh, I had to revert changes because I found multiple bugs in @ctypes.util.struct.

vstinner marked this pull request as draft July 19, 2026 01:03

Copy link
Copy Markdown
Member Author

Oh, I had to revert changes because I found multiple bugs in @ctypes.util.struct:

vstinner marked this pull request as ready for review July 19, 2026 11:22
_pyrepl is tested by mypy which doesn't know yet about
@ctypes.util.struct.

Copy link
Copy Markdown
Member Author

I converted structures of Lib/_pyrepl/windows_console.py to @ctypes.util.struct. The problem is that this file is tested by mypy with Python 3.15 which doesn't know about @ctypes.util.struct. So I reverted _pyrepl changes.

Copy link
Copy Markdown
Member Author

There are many structures defined in:

  • Lib/test/leakers/test_ctypes.py
  • Lib/test/test_ctypes/
  • ctypes.util
  • ctypes.wintypes
  • _pyrepl.windows_console

For _pyrepl, I left it unchanged because of the mypy issue described above.

ctypes sub-modules cannot use @ctypes.util.struct because they are used by ctypes.util (inter-dependencies).

test_ctypes contains just too many structures, I'm not suret that it's worth it to convert all of them.

vstinner enabled auto-merge (squash) July 19, 2026 12:06
vstinner merged commit ee50ed3 into python:main Jul 19, 2026
48 checks passed
vstinner deleted the ctypes_struct branch July 19, 2026 12:08
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant


Back | FazBrowse Home | New Git URL