general: switch to using native 3.8 versions for cached_property/Literal/Protocol instead of compat
This commit is contained in:
parent
c34656e8fb
commit
fe88380499
16 changed files with 29 additions and 98 deletions
|
@ -1,9 +1,8 @@
|
|||
from datetime import date, datetime
|
||||
from typing import Union, Tuple, Optional, Iterable, TextIO, Iterator
|
||||
from typing import Union, Tuple, Optional, Iterable, TextIO, Iterator, Protocol
|
||||
from dataclasses import dataclass
|
||||
|
||||
from my.core import __NOT_HPI_MODULE__
|
||||
from my.core.compat import Protocol
|
||||
|
||||
DateIsh = Union[datetime, date, str]
|
||||
|
||||
|
|
|
@ -73,7 +73,7 @@ def get_location(dt: datetime) -> LatLon:
|
|||
return loc[0].lat, loc[0].lon
|
||||
|
||||
|
||||
# TODO: in python3.9, use functools.cached_property instead?
|
||||
# TODO: in python3.8, use functools.cached_property instead?
|
||||
@lru_cache(maxsize=None)
|
||||
def homes_cached() -> List[Tuple[datetime, LatLon]]:
|
||||
return list(config._history)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue