-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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 pyscreeze stubs #8823
Add pyscreeze stubs #8823
Conversation
This comment has been minimized.
This comment has been minimized.
confidence: None = ..., | ||
) -> Box | None: ... | ||
def showRegionOnScreen(region: tuple[int, int, int, int], outlineColor: str = ..., filename: str = ...) -> None: ... | ||
def center(coords: Box) -> Point: ... |
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 center(coords: Box) -> Point: ... | |
def center(coords: tuple[int, int, int, int]) -> Point: ... |
The docstring just says that it needs a tuple.
|
||
grab = screenshot | ||
# _locateAll_opencv | ||
@overload |
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.
This is a strange use of overloads, since it looks like either one variant or the other is used depending on whether cv2 is present. Overloads are normally used when there are complicated relationships between different parameters and/or the return type. On the other hand, I can't think of any concrete ill effect of using overloads here, so I'm fine with keeping them.
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.
Yeah, since we can't represent that condition in typing, overloads are the next best thing so that both possible signatures are accurate.
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |
Removals from `stubinfo.py`: - `atomicwrites` is archived and deprecated at runtime; stubs were removed from typeshed in python/typeshed#8925 - `attrs` has had inline types for a very long time now - `chardet` recently cut a release with inline types; typeshed's stubs were marked obsolete in python/typeshed#9318 - `cryptography` has had inline types for a very long time now; the only reason why it's still in typeshed is because other typeshed packages need `types-cryptography` as a dependency, and our testing infrastructure therefore can't currently cope with it being removed from typeshed. - `emoji` recently cut a release bundling stubs with the runtime package; typeshed's stubs were marked obsolete in python/typeshed#9051 - `termcolor` recently cut a release with inline types; typeshed's stubs were marked obsolete in python/typeshed#8746 - `prettytable` recently cut a release with inline types; typeshed's stubs were marked obsolete in python/typeshed#9023 Additions: - Stubs for `Xlib` were added in python/typeshed#9279 - Stubs for `consolemenu` were added in python/typeshed#8820 - Stubs for `dockerfile_parse` were added in python/typeshed#9305 - Stubs for `flask_migrate` were added in python/typeshed#8967 - Stubs for `paho.mqtt` were added in python/typeshed#8853 - Stubs for `pycocotools` were added in python/typeshed#9086 - Stubs for many `pywin32` modules were added in python/typeshed#8825, and multiple follow-up PRs - Stubs for `pyscreeze` were added in python/typeshed#8823
A lot of it comes from https://github.com/python/typeshed/blob/master/stubs/PyAutoGUI/pyautogui/__init__.pyi
Predecessor to #8824