-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[python-dateutil] add some more missing paramater type annotations #14996
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
base: main
Are you sure you want to change the base?
Conversation
This comment has been minimized.
This comment has been minimized.
| 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: ... |
There was a problem hiding this comment.
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:
| 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 |
There was a problem hiding this comment.
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
| 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 |
|
Thank you! Few nits above |
|
Thanks for the great suggestions! |
|
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |
Some things I missed in #14992