Skip to content

Type stub for win32com.server #14492

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

Type stub for win32com.server #14492

wants to merge 5 commits into from

Conversation

qwertycxz
Copy link

fix #14440.

This comment has been minimized.

Copy link
Member

@brianschubert brianschubert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, left some comments below


def RegisterClassFactories(
clsids: Iterable[PyIID], flags: int | None = None, clsctx: int | None = None
) -> list[tuple[PyIClassFactory, Any]]: ...
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Uses of Any need to be accompanied by a comment explaining why Any is needed / what types are possible at runtime.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your review! I accepted all your comments. :D

For the Any here, I looked up the C code of pywin32 and found that two of them are int. They are now welled annotated. (I also update the pythoncom.pyi to meet the two ints). The third Any is because it has no use. I add a comment explaining that.

def _set_string(path: str | None, value: str, base: PyHKEY | int = HKEY_CLASSES_ROOT) -> None: ...
def _get_string(path: str | None, base: PyHKEY | int = HKEY_CLASSES_ROOT) -> str | None: ...
def _remove_key(path: str | None, base: PyHKEY | int = HKEY_CLASSES_ROOT) -> None: ...
def recurse_delete_key(path: str | None, base: PyHKEY | int = HKEY_CLASSES_ROOT) -> None: ...
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
def recurse_delete_key(path: str | None, base: PyHKEY | int = HKEY_CLASSES_ROOT) -> None: ...
def recurse_delete_key(path: str | None, base: PyHKEY | int = -2147483648) -> None: ...

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Although, I'm wondering, is it really good to replace HKEY_CLASSES_ROOT? This constant seems to be better understood。

This comment has been minimized.

Copy link
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

win32com.server.register is missing?
2 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy