Skip to content

Commit 8200c23

Browse files
authored
Mark logbook.EventAsRow with @Final (#142058)
1 parent dfd86d5 commit 8200c23

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

homeassistant/components/logbook/models.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
from collections.abc import Callable, Mapping
66
from dataclasses import dataclass
7-
from typing import TYPE_CHECKING, Any, Final, NamedTuple, cast
7+
from typing import TYPE_CHECKING, Any, Final, NamedTuple, cast, final
88

99
from propcache.api import cached_property
1010
from sqlalchemy.engine.row import Row
@@ -114,6 +114,7 @@ def context_parent_id(self) -> str | None:
114114
CONTEXT_POS: Final = 12
115115

116116

117+
@final # Final to allow direct checking of the type instead of using isinstance
117118
class EventAsRow(NamedTuple):
118119
"""Convert an event to a row.
119120

0 commit comments

Comments
 (0)