Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace type alias with compatible symbols that can be imported from ctypes.wintypes. #662

Open
junkmd opened this issue Nov 10, 2024 · 0 comments
Labels
good first issue Good for newcomers

Comments

@junkmd
Copy link
Collaborator

junkmd commented Nov 10, 2024

The line in __init__.py defining DWORD as an alias for c_ulong has been present since the project’s earliest commit, 938fbd5.

DWORD = c_ulong

On the other hand, in commit 56908fd, which added shelllink.py two years later, DWORD was imported from ctypes.wintypes.

from ctypes.wintypes import DWORD, WIN32_FIND_DATAA, WIN32_FIND_DATAW, MAX_PATH

The originator of ctypes and comtypes is the same person, and these libraries have historically evolved together, which has led to differences in symbol definitions like this.

Now, however, defining these aliases independently holds little value, so we could replace them where possible.

-DWORD = c_ulong
+from ctypes.wintypes import DWORD
  • We welcome keeping changes as small as possible per pull request, as it makes it easier for reviewers to check the changes.

  • If your PR addresses multiple rules or files, reviewers might consider it a large change and suggest splitting it into multiple PRs.

@junkmd junkmd added the good first issue Good for newcomers label Nov 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant