my.time.tz: implement different policies for localizing
This commit is contained in:
parent
15789a4149
commit
3a9e3e080f
7 changed files with 93 additions and 16 deletions
|
@ -273,7 +273,8 @@ class classproperty(Generic[_R]):
|
|||
# def __get__(self) -> _R:
|
||||
# return self.f()
|
||||
|
||||
# TODO maybe use opaque mypy alias?
|
||||
# for now just serves documentation purposes... but one day might make it statically verifiable where possible?
|
||||
# TODO e.g. maybe use opaque mypy alias?
|
||||
tzdatetime = datetime
|
||||
|
||||
|
||||
|
|
|
@ -15,6 +15,11 @@ ResT = Union[T, E]
|
|||
Res = ResT[T, Exception]
|
||||
|
||||
|
||||
def notnone(x: Optional[T]) -> T:
|
||||
assert x is not None
|
||||
return x
|
||||
|
||||
|
||||
def unwrap(res: Res[T]) -> T:
|
||||
if isinstance(res, Exception):
|
||||
raise res
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue