Skip to content

Add stubs for dirhash package #13437

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

Merged
merged 5 commits into from
Feb 27, 2025
Merged

Conversation

loic-simon
Copy link
Contributor

Stub files for the dirhash package.

Some (not fundamental) annotations depend on scantree, which is also untyped; I may add stubs for it later.

This comment has been minimized.

Copy link
Collaborator

@srittau srittau left a comment

Choose a reason for hiding this comment

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

Thanks, looks mostly good. One comment below.

from typing import Any

def main() -> None: ...
def get_kwargs(args: list[str]) -> dict[str, Any]: ...
Copy link
Collaborator

Choose a reason for hiding this comment

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

ArgumentParser.parse_args() (which get_kwargs() ultimately calls) accepts any Sequence.

Also, we now require all instances of Any to be documented:

Suggested change
def get_kwargs(args: list[str]) -> dict[str, Any]: ...
def get_kwargs(args: Sequence[str]) -> dict[str, Any]: ... # value depends on the key

(Will need import of Sequence from collections.abc.)

Copy link
Contributor Author

@loic-simon loic-simon Feb 27, 2025

Choose a reason for hiding this comment

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

Fixed, thanks! Indeed, I haven't given much thought to cli.py annotations since it's not meant to be imported 😄

Copy link
Contributor

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

@loic-simon loic-simon requested a review from srittau February 27, 2025 13:04
@srittau srittau merged commit d0c8ac4 into python:main Feb 27, 2025
43 checks passed
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