-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
base: main
Are you sure you want to change the base?
Conversation
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this 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]]: ... |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 int
s). 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: ... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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: ... |
There was a problem hiding this comment.
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.
This comment has been minimized.
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |
fix #14440.