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

Improve source code readability with type annotations #1844

Open
mr-eyes opened this issue Feb 17, 2022 · 2 comments
Open

Improve source code readability with type annotations #1844

mr-eyes opened this issue Feb 17, 2022 · 2 comments

Comments

@mr-eyes
Copy link
Member

mr-eyes commented Feb 17, 2022

Given the growth of the source code, tracking inputs/returns of functions/classes is not smooth, mainly when working on a very connected code. I think it will be super helpful to start adding type hints while developing something new or editing something old.

References:

@ctb
Copy link
Contributor

ctb commented Feb 21, 2022

I'm at +/-0 on this - I intellectually understand that they can be valuable, and this case study is pretty convincing, but I think they also raise the bar for code contribution even more than tests do. And from the case study above:

This effort took many months for our team to complete so make sure to allocate enough time.

...I would like to point out that we are not exactly replete with developer time, so, you know, let's be careful, eh?

So a few miscellaneous thoughts and feelings:

  • I absolutely am not in favor of a large-scale effort here. We should add them gradually, if at all, and make sure we build out the practice of adding them.
  • there are "internal API" modules and classes that I suspect would benefit the most. Think search.py, compare.py, manifest.py, picklist.py, signature.py, minhash.py, and so on - but not commands.py, or the code under cli/.

Feedback welcome!

@ctb
Copy link
Contributor

ctb commented Mar 26, 2022

a basic tutorial, for later reference for myself, if no one else :)

https://realpython.com/python-type-checking/

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

No branches or pull requests

2 participants