Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added type hints for the public functions #153

Merged
merged 1 commit into from
Oct 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions tzlocal/unix.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ def _get_localzone(_root="/"):
return tz


def get_localzone_name():
def get_localzone_name() -> str:
"""Get the computers configured local timezone name, if any."""
global _cache_tz_name
if _cache_tz_name is None:
Expand All @@ -211,7 +211,7 @@ def get_localzone_name():
return _cache_tz_name


def get_localzone():
def get_localzone() -> zoneinfo.ZoneInfo:
"""Get the computers configured local timezone, if any."""

global _cache_tz
Expand All @@ -221,7 +221,7 @@ def get_localzone():
return _cache_tz


def reload_localzone():
def reload_localzone() -> zoneinfo.ZoneInfo:
"""Reload the cached localzone. You need to call this if the timezone has changed."""
global _cache_tz_name
global _cache_tz
Expand Down
6 changes: 3 additions & 3 deletions tzlocal/win32.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def _get_localzone_name():
return timezone


def get_localzone_name():
def get_localzone_name() -> str:
"""Get the zoneinfo timezone name that matches the Windows-configured timezone."""
global _cache_tz_name
if _cache_tz_name is None:
Expand All @@ -121,7 +121,7 @@ def get_localzone_name():
return _cache_tz_name


def get_localzone():
def get_localzone() -> zoneinfo.ZoneInfo:
"""Returns the zoneinfo-based tzinfo object that matches the Windows-configured timezone."""

global _cache_tz
Expand All @@ -137,7 +137,7 @@ def get_localzone():
return _cache_tz


def reload_localzone():
def reload_localzone() -> zoneinfo.ZoneInfo:
"""Reload the cached localzone. You need to call this if the timezone has changed."""
global _cache_tz
global _cache_tz_name
Expand Down