Type checking tools for Python 2?

Terry Reedy tjreedy at udel.edu
Tue Apr 21 14:29:54 EDT 2015


On 4/21/2015 2:08 PM, Skip Montanaro wrote:
> I've been following along with the discussions related to type
> hints[1] on python-ideas and python-dev. I'm interested enough to
> start looking into this for my own nefarious purposes. At work, we
> have lots of C++ code wrapped by Boost.Python. It seems like creating
> type hint stubs for those libraries might be useful. Even if it proves
> not to be all that useful for me, it's a ready code base which I could
> mess around with and not bother anybody else.
>
> Alas, my environment is still 100% Python 2.7. It looks like mypy
> isn't going to be doing Python 2.x anytime soon. Are there any type
> hint/check tools available which will work with Python 2?

I believe mypy can typecheck 2.x code in conjunction with stub files. 
The fact that you have to install Python 3 to run mypy should be irrelevant.

-- 
Terry Jan Reedy




More information about the Python-list mailing list