HPI/my/time/tz/main.py
Dima Gerasimov 973c4205df core: cleanup deprecations, exclude from type checking and show runtime warnings
among affected things:

- core.common.assert_never
- core.common.cproperty
- core.common.isoparse
- core.common.mcachew
- core.common.the
- core.common.tzdatetime
- core.compat.sqlite_backup
2024-08-16 10:22:29 +01:00

13 lines
616 B
Python

'''
Timezone data provider, used to localize timezone-unaware timestamps for other modules
'''
from datetime import datetime
from my.core.common import datetime_aware
# todo hmm, kwargs isn't mypy friendly.. but specifying types would require duplicating default args. uhoh
def localize(dt: datetime, **kwargs) -> datetime_aware:
# todo document patterns for combining multiple data sources
# e.g. see https://github.com/karlicoss/HPI/issues/89#issuecomment-716495136
from . import via_location as L
from .common import localize_with_policy
return localize_with_policy(L.localize, dt, **kwargs)