asweigart / pyscreeze

PyScreeze is a simple, cross-platform screenshot module for Python 2 and 3.
BSD 3-Clause "New" or "Revised" License
193 stars 96 forks source link

Type hints #87

Open Avasam opened 2 years ago

Avasam commented 2 years ago

3rd party pyscreeze type stubs have been added to typeshed (by myself) https://github.com/python/typeshed/tree/master/stubs/PyScreeze

It'd be best if the stubs were part of pyscreeze itself. You should be able to use them directly from typeshed (and they should be fairly accurate). Although they also wouldn't be removed from typeshed until a PyPI release of pyscreeze includes the stubs.

Ultimately, the best scenario is to have inline typing directly, as it reduces chances of desync between stubs and implementation, and allows for easy type-checking in the CI and during development. However, due to the Python2 support requirement, inline type comments may be annoying, and will be more complicated to support multiple Python version while trying to keep typing as accurate as possible depending on what said version supports.

Avasam commented 2 years ago

https://github.com/asweigart/pyautogui/issues/645