Skip to content

Conversation

@lev-blit
Copy link
Contributor

@lev-blit lev-blit commented Nov 8, 2025

Some things I missed in #14992

@github-actions

This comment has been minimized.

@lev-blit lev-blit marked this pull request as ready for review November 8, 2025 15:09
def __init__(self, tzres_loc="tzres.dll"): ...
def load_name(self, offset): ...
def name_from_string(self, tzname_str: str): ...
def __init__(self, tzres_loc: str = "tzres.dll") -> None: ...
Copy link
Contributor

@donBarbos donBarbos Nov 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be worth using a type that ctypes.WinDLL() accepts inside (_NameTypes is type alias from ctypes),
and attribute could be specified right away:

Suggested change
def __init__(self, tzres_loc: str = "tzres.dll") -> None: ...
tzres_loc: _NameTypes
def __init__(self, tzres_loc: _NameTypes = "tzres.dll") -> None: ...


def rebuild(filename: StrOrBytesPath, tag=None, format: str = "gz", zonegroups: Iterable[str] = [], metadata=None) -> None: ...
def rebuild(
filename: StrOrBytesPath, tag=None, format: str = "gz", zonegroups: Iterable[str] = [], metadata: dict[str, Any] | None = None
Copy link
Contributor

@donBarbos donBarbos Nov 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think Incomplete is more appropriate here since it is used for the return type from gettz_db_metadata

and if _MetadataType (type alias to dict[str, Incomplete]) is changed to TypedDict, it will be changed at the same time

Suggested change
filename: StrOrBytesPath, tag=None, format: str = "gz", zonegroups: Iterable[str] = [], metadata: dict[str, Any] | None = None
filename: StrOrBytesPath, tag=None, format: str = "gz", zonegroups: Iterable[str] = [], metadata: _MetadataType | None = None

@donBarbos
Copy link
Contributor

Thank you! Few nits above

@lev-blit
Copy link
Contributor Author

lev-blit commented Nov 8, 2025

Thanks for the great suggestions!

@github-actions
Copy link
Contributor

github-actions bot commented Nov 8, 2025

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants