Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><strong>Edit 2016-11-11:</strong> Just use <a href="http://www.mypy-lang.org/" rel="nofollow noreferrer">mypy</a>. Type hints can be added gradually. In Python 3 source code, it verifies standard <a href="https://www.python.org/dev/peps/pep-0484/" rel="nofollow noreferrer">PEP 484</a> type hints. Types can still be expressed in Python 2 using special comments. <a href="https://mail.python.org/pipermail/python-ideas/2014-August/028618.html" rel="nofollow noreferrer">Guido likes it</a>.</p> <p>This post was originally written a long time ago before mypy was a thing. I've preserved the post's original content below, even though it isn't quite accurate.</p> <hr> <p><strong>Original post:</strong></p> <p>You might want to check out some of the projects mentioned in this <a href="https://stackoverflow.com/questions/35470/are-there-any-static-analysis-tools-for-python">related StackOverflow post on static analysis for Python</a>.</p> <p>In summary:</p> <ul> <li><a href="http://www.logilab.org/project/pylint" rel="nofollow noreferrer">pylint</a></li> <li><a href="http://pypi.python.org/pypi/pyflakes" rel="nofollow noreferrer">PyFlakes</a></li> <li><a href="http://pychecker.sourceforge.net/" rel="nofollow noreferrer">PyChecker</a></li> </ul> <p>Since Python uses <a href="http://en.wikipedia.org/wiki/Duck_typing" rel="nofollow noreferrer">duck typing</a> extensively, things that might be called "type errors" in other languages might end up being "object <em>X</em> doesn't support method <em>Y</em>" in Python.</p> <p><strong>Edit 2011-05-17:</strong></p> <p>I agree with delnan that static typing is not possible for Python <em>[apparently wrong]</em>. But since our skepticism doesn't seem to deter you, I can only give you more information on the subject. I present:</p> <ul> <li>A discussion of <a href="http://lambda-the-ultimate.org/node/1519" rel="nofollow noreferrer">type inference for Python</a>. (Other links are from here.)</li> <li>Guido van van Rossum's articles on adding optional static typing: <a href="http://www.artima.com/weblogs/viewpost.jsp?thread=85551" rel="nofollow noreferrer">part 1</a> and <a href="http://www.artima.com/weblogs/viewpost.jsp?thread=86641" rel="nofollow noreferrer">part 2</a>.</li> <li><a href="http://code.google.com/p/rpython/" rel="nofollow noreferrer">RPython</a>, a subset of Python that might stand a chance of being statically analyzed enough to do some form of type checking.</li> </ul>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload