MonkeyType does not pip install on Python 2, and it does not appear to be able to inspect python 2 code either. Also, even in Python 3, it appears that monkeytype is unable (?) to derive an annotation for the powers_of_2 generator. It does appear to be able to do OK with user-defined classes. It's more of a starting point than a finished product. It appears that sometimes generators are handled; the squares generator, which is called without a zip, is handled nicely. Note that monkeytype is adding Iterator, not typing.Iterator, and there is no import added - that can be done manually though.