Skip to content

Commit 6e71a35

Browse files
committed
Update event type attributes.
1 parent 9a9fa27 commit 6e71a35

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

tcod/event.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -656,7 +656,7 @@ class WindowEvent(Event):
656656
type (str): A window event could mean various event types.
657657
"""
658658

659-
type: Final[ # type: ignore[misc] # Narrowing contant type.
659+
type: Final[ # type: ignore[misc] # Narrowing final type.
660660
Literal[
661661
"WindowShown",
662662
"WindowHidden",
@@ -726,7 +726,7 @@ class WindowMoved(WindowEvent):
726726
y (int): Movement on the y-axis.
727727
"""
728728

729-
type: Literal["WINDOWMOVED"] # type: ignore[assignment,misc]
729+
type: Final[Literal["WINDOWMOVED"]] # type: ignore[assignment,misc]
730730

731731
def __init__(self, x: int, y: int) -> None:
732732
super().__init__(None)
@@ -757,7 +757,7 @@ class WindowResized(WindowEvent):
757757
height (int): The current height of the window.
758758
"""
759759

760-
type: Literal["WINDOWRESIZED", "WINDOWSIZECHANGED"] # type: ignore[assignment,misc]
760+
type: Final[Literal["WINDOWRESIZED", "WINDOWSIZECHANGED"]] # type: ignore[assignment,misc]
761761

762762
def __init__(self, type: str, width: int, height: int) -> None:
763763
super().__init__(type)
@@ -962,6 +962,8 @@ class JoystickDevice(JoystickEvent):
962962
del joysticks[which]
963963
"""
964964

965+
type = Final[Literal["JOYDEVICEADDED", "JOYDEVICEREMOVED"]] # type: ignore[assignment,misc]
966+
965967
which: int
966968
"""When type="JOYDEVICEADDED" this is the device ID.
967969
When type="JOYDEVICEREMOVED" this is the instance ID.

0 commit comments

Comments
 (0)