Global-Biofoundries-Alliance/SynBioPython

using type hint/type annotation by default

zoltuz opened this issue · 4 comments

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 commented

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.

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.

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

Sure, sounds good to me!