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

Complete coverage for the qrcode package #12675

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

mjpieters
Copy link
Contributor

This PR covers all of the project. This library is somewhat underdocumented so
I erred on the side of covering all modules with public names.

This comment has been minimized.

@mjpieters mjpieters force-pushed the types-qrcode-complete branch 3 times, most recently from d454e5b to 50c3950 Compare September 17, 2024 20:12

This comment has been minimized.

This comment has been minimized.

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! Not a complete review, but we require Anys to be documented (either using a comment or using an appropriate type alias). I noticed that you added Any annotations to a few kwargs arguments which are - I suspect - forwarded to another function. In this case, we could copy the arguments over (or leave kwargs unannotated for now).

@mjpieters
Copy link
Contributor Author

Thanks! Not a complete review, but we require Anys to be documented (either using a comment or using an appropriate type alias). I noticed that you added Any annotations to a few kwargs arguments which are - I suspect - forwarded to another function. In this case, we could copy the arguments over (or leave kwargs unannotated for now).

I'll review these again and document where I can. I certainly may have missed some forwarded calls in this project.

However, there are some bad practices in the codebase, like a ABCs with an empty (non-abstract) __init__ method with **kwargs and no types. I think I may just remove these from the annotations instead.

- Reflect forwarded arguments where I missed them before
- Document the remaining Any arguments.
Copy link
Contributor

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

@srittau
Copy link
Collaborator

srittau commented Sep 18, 2024

However, there are some bad practices in the codebase, like a ABCs with an empty (non-abstract) init method with **kwargs and no types. I think I may just remove these from the annotations instead.

You could either remove them if you think that no valid code should call __init__ with arguments, or you could use _typeshed.Unused to mark that fact.

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