Skip to content

Commit

Permalink
[pynput] Fix annotations of Controller.Key(Code) (#8722)
Browse files Browse the repository at this point in the history
Document stubtest entries
  • Loading branch information
AlexWaygood authored Sep 12, 2022
1 parent 266aa3b commit 34383fc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
10 changes: 4 additions & 6 deletions stubs/pynput/@tests/stubtest_allowlist.txt
Original file line number Diff line number Diff line change
@@ -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.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._base.Controller._KeyCode
pynput.keyboard._dummy.Controller._Key
pynput.keyboard._dummy.Controller._KeyCode
pynput.mouse.Controller.__init__
4 changes: 2 additions & 2 deletions stubs/pynput/pynput/keyboard/_base.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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): ...
Expand Down

0 comments on commit 34383fc

Please sign in to comment.