-
Notifications
You must be signed in to change notification settings - Fork 810
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
Add Type Hint for win32api.GetLastError
#2468
Comments
There are no .pyi files in the repo. |
Thank you for the response. I am a student new to type-hints and |
Hello @songyuc . Type stubs for pywin32 are handled as third-party stubs in https://github.com/python/typeshed/tree/main/stubs/pywin32 . Feel free to re-open your issue there. I opened #2469 to hopefully help direct users of type annotations to the proper resources.
That is an absolute massive undertaking that I've been working on over the past 2 years now. pywin32 has some inline type annotations, and basic (but not great) static type-checking coverage of its own usage. What's most likely to happen, and my current plan, is that most pure-python modules in pywin32 get annotated. And c-extensions stay delegated to typeshed (third party stubs can be marked as |
Hello,
When using PyCharm for development, the method
win32api.GetLastError
does not have an associated type hint in thewin32api.pyi
file. This absence leads to the following warning in PyCharm:This makes it difficult to utilize autocomplete and type checking features effectively.
Suggested Solution
Add a type hint for the
GetLastError
method in thewin32api.pyi
file to enhance IDE support and improve the development experience. The type hint should specify thatGetLastError
returns an integer.Additional Information
pywin32
version: 308Benefits
Thank you for maintaining the
pywin32
library and for considering this enhancement!The text was updated successfully, but these errors were encountered: