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

using type hint/type annotation by default #5

Open
zoltuz opened this issue Jan 20, 2020 · 4 comments
Open

using type hint/type annotation by default #5

zoltuz opened this issue Jan 20, 2020 · 4 comments

Comments

@zoltuz
Copy link

zoltuz commented Jan 20, 2020

Type hinting has been revamped in python 3.5 (I think), and offers a consistent notation for type hinting in the source code:
http://veekaybee.github.io/2019/07/08/python-type-hints/

Most IDEs now support this, and checks the type hints during coding, also packages can do type checking before commiting to the repo. I highly recommend it!

Any questions, comments?

@Zulko
Copy link
Contributor

Zulko commented Jan 20, 2020

I vote for "yes at some point". Definitely a good practice, but I think that in this this project we will be contributing our previously-written code in a first time, so enforcing type-checking early could be a slow-down.

@zoltuz
Copy link
Author

zoltuz commented Jan 20, 2020

The good thing is that you can have 'mixed code', part annotated, part unannotated. The IDE won't complain about this state. The pre-commit checkers can have a whitelist for the unannotated part.

The unannotated part later on can be:

  • automatically annotated https://github.com/dropbox/pyannotate
  • used as a good first task to add the missing type hints for people joining the project, but generally unfamiliar with the source code.

@neilswainston
Copy link
Contributor

Maybe do this on a voluntary basis initially and update / enforce later if we see fit?

@zoltuz
Copy link
Author

zoltuz commented Jan 20, 2020

Sure, sounds good to me!

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

3 participants