Skip to content

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

Description

@junkmd

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions