Skip to content

Commit 34383fc

Browse files
authored
[pynput] Fix annotations of Controller.Key(Code) (#8722)
Document stubtest entries
1 parent 266aa3b commit 34383fc

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed
+4-6
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
# TODO: go through this allowlist, figure out which of them are false positives
2-
pynput.keyboard.Controller._Key
3-
pynput.keyboard.Controller._KeyCode
1+
# These __init__ methods have *args, **kwargs arguments on some platforms, but not others
42
pynput.keyboard.Controller.__init__
3+
pynput.mouse.Controller.__init__
4+
# stubtest issues with non-`type` metaclasses, see https://github.com/python/mypy/issues/13316
5+
pynput.keyboard.Controller._Key
56
pynput.keyboard._base.Controller._Key
6-
pynput.keyboard._base.Controller._KeyCode
77
pynput.keyboard._dummy.Controller._Key
8-
pynput.keyboard._dummy.Controller._KeyCode
9-
pynput.mouse.Controller.__init__

stubs/pynput/pynput/keyboard/_base.pyi

+2-2
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@ class Key(enum.Enum):
8686
scroll_lock: int
8787

8888
class Controller:
89-
_KeyCode: ClassVar[KeyCode] # undocumented
90-
_Key: ClassVar[Key] # undocumented
89+
_KeyCode: ClassVar[type[KeyCode]] # undocumented
90+
_Key: ClassVar[type[Key]] # undocumented
9191

9292
class InvalidKeyException(Exception): ...
9393
class InvalidCharacterException(Exception): ...

0 commit comments

Comments
 (0)