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

Adding type hints to the codebase #1608

Open
outa opened this issue Oct 8, 2022 · 2 comments
Open

Adding type hints to the codebase #1608

outa opened this issue Oct 8, 2022 · 2 comments
Labels
enhancement New feature or request
Milestone

Comments

@outa
Copy link
Contributor

outa commented Oct 8, 2022

Use Case/Motivation

Hi,

how do you feel about adding type hints to functions and methods in the code?

I think that in addition to catching and avoiding bugs, it would also make the code easier to understand for new contributors.

Plus one could add some kind of static type checker to the CI

Example Usage

n/a

Other Information

I'm willing to submit a PR

@outa outa added 🆕 New! enhancement New feature or request labels Oct 8, 2022
@micahellison
Copy link
Member

Thanks for filing this, and yes, we're into it! Just a couple things to be mindful of:

Right now we have an open draft PR #1602 that does this in a few places, so it might be worth glancing at that so you don't have to duplicate any work.

The other issue is that type hints have been changing rapidly over the past few Python releases, as we're seeing in that same PR (the tests in Python 3.9 are failing). We plan to merge it when we drop Python 3.9 support later this month, so don't worry about any failing 3.9 tests if you tackle this.

@micahellison micahellison removed the 🆕 New! label Oct 8, 2022
@micahellison micahellison added this to the Backlog milestone Oct 8, 2022
@outa outa mentioned this issue Oct 12, 2022
4 tasks
@micahellison
Copy link
Member

The bulk of the work is done (thanks @outa) though I'm leaving this open because we don't quite have enough static type checking yet. Once we have that in place and without errors, I think we can close this issue.

Looks like we'll probably be picking between mypy and pedantic, or maybe others. Suggestions are welcome.

@outa outa mentioned this issue Nov 25, 2022
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants