-
Notifications
You must be signed in to change notification settings - Fork 12
Closed
Description
Hi,
What is the policy for contributing to type annotations? Are such contributions welcome?
My motivation for having high-quality type annotations is as follows:
- When using
pins-python, type annotations can improve the user experience for editors that use type-based syntax highlighting. - Type annotations can improve the user experience for users who are using type checking tools such as
mypy. - When contributing to
pins-python, type annotations serve as a form of documentation that make it easier to understand the codebase. I am currently trying to get my head around things 😄
Some considerations: - Perhaps a pre-requisite is that a type checker is configured for the project (to ensure annotations are actually correct). Would you be open to this?
- Some functions e.g.
pins.versions.version_setupare currently unannotated but annotating them would introduce a cyclic dependency which could not be fixed withoutfrom future import __annotations__or refactoring. Personally, I think refactoring in such cases can introduce clarity but there are definitely trade-offs. It would be good to know if this sort of refactoring is "off limits". - Some functions such as
pins.boards.BaseBoard.pin_versionscould have more narrowly scoped types using@overloadto differentiate cases. You may find the complexity this introduces to be unacceptable, it would be good to know if this is the case.
Metadata
Metadata
Assignees
Labels
No labels