mirror of
https://github.com/home-assistant/core.git
synced 2025-04-23 16:57:53 +00:00
Mark Event and HassJob with @final (#142055)
This commit is contained in:
parent
93ea88f3de
commit
93162f6b65
@ -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."""
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user