Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Adding type annotations to several files #760
Looking for @todd-cook 's thoughts about my type annotations to
also cc @jtauber
I ran mypy with
It took me some hours to grok the annotations, however now that I kinda get them -- I am totally sold on their value. But if I am doing something crazy, don't hesitate to let me know.
@@ Coverage Diff @@ ## master #760 +/- ## ========================================== - Coverage 87.76% 87.76% -0.01% ========================================== Files 148 148 Lines 8828 8834 +6 ========================================== + Hits 7748 7753 +5 - Misses 1080 1081 +1
A few notes about MyPy:
Besides the obvious standard types, Any and NamedTuple are helpful for annotating user defined types and data coming from external libraries (e.g. SqlAlchemy, and others).
The true value of MyPy comes during active development, when it uncovers bugs before finding them at runtime. I'm glad you're becoming a fan!
I skimmed the mypy doc pages on stubs and typeshed. I kinda get it. My instinct is the get down the type annotations for our own library, then move on to stubs (or whatever) to make up the missing remainder.
OK, I'll read about this.