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

Type hints and type check #266

Open
DifferentialOrange opened this issue Nov 23, 2022 · 2 comments
Open

Type hints and type check #266

DifferentialOrange opened this issue Nov 23, 2022 · 2 comments
Labels
code health Improve code readability, simplify maintenance and so on needs feedback Something is unclear with the issue

Comments

@DifferentialOrange
Copy link
Member

Type hints is a modern Python way to provide type information (see typing mypy). PR #264 is the first one to potentially use type hints, but it would be nice to have it anywhere.

Type asserts is a more tricky question. For now there are some minor type checks and asserts in connector. Some may also be implemented in PR #264. But it is a big question if they should be use. It seems that there are both adepts of using (since it is a convenient concept) and forbidding to use (since it contradicts Python duck typing principle) it. For example, see this StackOverflow thread. One way or another, it would be good to at least have a consistency on this question.

Since now package is fully documented, it should be easy to implement type hints and asserts after one decide what approach we should stick to. But choosing the approach is the question.

@DifferentialOrange DifferentialOrange added teamE needs feedback Something is unclear with the issue code health Improve code readability, simplify maintenance and so on labels Nov 23, 2022
@DifferentialOrange
Copy link
Member Author

We should consider linting with mypy after adding this

@olegrok
Copy link
Contributor

olegrok commented Mar 30, 2023

You can consider also https://pyre-check.org/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code health Improve code readability, simplify maintenance and so on needs feedback Something is unclear with the issue
Projects
None yet
Development

No branches or pull requests

3 participants