[pynput] Fix annotations of Controller.Key(Code) (#8722)

Document stubtest entries
This commit is contained in:
Alex Waygood
2022-09-12 12:30:57 +01:00
committed by GitHub
parent 266aa3b6ca
commit 34383fcab5
2 changed files with 7 additions and 9 deletions

View File

@@ -1,9 +1,7 @@
# TODO: go through this allowlist, figure out which of them are false positives
pynput.keyboard.Controller._Key
pynput.keyboard.Controller._KeyCode
# These __init__ methods have *args, **kwargs arguments on some platforms, but not others
pynput.keyboard.Controller.__init__
pynput.keyboard._base.Controller._Key
pynput.keyboard._base.Controller._KeyCode
pynput.keyboard._dummy.Controller._Key
pynput.keyboard._dummy.Controller._KeyCode
pynput.mouse.Controller.__init__
# stubtest issues with non-`type` metaclasses, see https://github.com/python/mypy/issues/13316
pynput.keyboard.Controller._Key
pynput.keyboard._base.Controller._Key
pynput.keyboard._dummy.Controller._Key

View File

@@ -86,8 +86,8 @@ class Key(enum.Enum):
scroll_lock: int
class Controller:
_KeyCode: ClassVar[KeyCode] # undocumented
_Key: ClassVar[Key] # undocumented
_KeyCode: ClassVar[type[KeyCode]] # undocumented
_Key: ClassVar[type[Key]] # undocumented
class InvalidKeyException(Exception): ...
class InvalidCharacterException(Exception): ...