Mark Event and HassJob with @final (#142055)

This commit is contained in:
Erik Montnemery 2025-04-02 14:04:48 +02:00 committed by GitHub
parent 93ea88f3de
commit 93162f6b65
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -38,6 +38,7 @@ from typing import (
TypedDict,
TypeVar,
cast,
final,
overload,
)
@ -324,6 +325,7 @@ class HassJobType(enum.Enum):
Executor = 3
@final # Final to allow direct checking of the type instead of using isinstance
class HassJob[**_P, _R_co]:
"""Represent a job to be run later.
@ -1317,6 +1319,7 @@ class EventOrigin(enum.Enum):
return next((idx for idx, origin in enumerate(EventOrigin) if origin is self))
@final # Final to allow direct checking of the type instead of using isinstance
class Event(Generic[_DataT]):
"""Representation of an event within the bus."""