mirror of
https://github.com/zulip/zulip.git
synced 2025-11-15 11:22:04 +00:00
While it's true `datetime` is implicit via `pytz`, it makes sense that mypy should now complain about the semantics of calling our return type `pytz.datetime.tzinfo`, when such a type doesn't actually exist.
12 lines
207 B
Python
12 lines
207 B
Python
|
|
from typing import List
|
|
|
|
import pytz
|
|
import datetime
|
|
|
|
def get_all_timezones() -> List[str]:
|
|
return sorted(pytz.all_timezones)
|
|
|
|
def get_timezone(tz: str) -> datetime.tzinfo:
|
|
return pytz.timezone(tz)
|