<tt><font size=2>&gt; From: John Reiser &lt;jreiser@bitwagon.com&gt;</font></tt>
<br><tt><font size=2>&gt; To: Development discussions related to Fedora
&lt;devel@lists.fedoraproject.org&gt;</font></tt>
<br><tt><font size=2>&gt; Date: 10/22/2012 11:25</font></tt>
<br><tt><font size=2>&gt; Subject: tools to catch AttributeError and TypeError
in python code?</font></tt>
<br><tt><font size=2>&gt; Sent by: devel-bounces@lists.fedoraproject.org</font></tt>
<br><tt><font size=2>&gt; <br>
&gt; What is the state of software tools to help catch and prevent<br>
&gt; AttributeError and TypeError in python code? &nbsp;These two classes<br>
&gt; of errors occur often in the bugzilla reports for anaconda<br>
&gt; (recently: &nbsp;</font></tt><a href="https://bugzilla.redhat.com/show_bug.cgi?id=868707"><tt><font size=2>https://bugzilla.redhat.com/show_bug.cgi?id=868707</font></tt></a><tt><font size=2>
).<br>
&gt; I'd like to see fewer AttributeError and TypeError.<br>
&gt; <br>
&gt; Because new attributes and types may be created at run time, in general<br>
&gt; errors may be even harder to find than in languages with static typing.<br>
&gt; Yet for most python code the set of types and attributes is semi-fixed.<br>
&gt; There are no changes at run time except due to importing modules<br>
&gt; which were created long ago. &nbsp;During development, the set of
types and<br>
&gt; attributes changes only in bursts, and often the bursts are weeks
apart.<br>
&gt; <br>
&gt; The tools for python that I found by searching the web [0][1] seemed
to be<br>
&gt; oriented more towards syntax and style, and not including AttributeError<br>
&gt; and TypeError. &nbsp;Nothing even came close to the depth and thoroughness<br>
&gt; of BEAM [2] or Coverity [3] for C/C++. &nbsp;Help?<br>
&gt; <br>
&gt; -----<br>
&gt; [0] google: &nbsp;python code checker<br>
&gt; [1] </font></tt><a href=http://en.wikipedia.org/wiki/List_of_tools_for_static_code_analysis#Python><tt><font size=2>http://en.wikipedia.org/wiki/List_of_tools_for_static_code_analysis#Python</font></tt></a><tt><font size=2><br>
&gt; &nbsp; &nbsp;pychecker<br>
&gt; &nbsp; &nbsp;pylint<br>
&gt; [2] </font></tt><a href=http://alexandria.tue.nl/extra2/afstversl/E/523798.pdf><tt><font size=2>http://alexandria.tue.nl/extra2/afstversl/E/523798.pdf</font></tt></a><tt><font size=2><br>
&gt; &nbsp; &nbsp;(IBM &quot;BEAM&quot; checker [Bugs, Errors, And Mistakes];
Guido Volleberg, 1999)<br>
&gt; &nbsp; &nbsp;*very* good: finds and prints an execution path which
leads to null-pointer<br>
&gt; &nbsp; &nbsp;errors in C and C++; includes call+return, loop+exit,
conditionals, etc.<br>
&gt; &nbsp; &nbsp;Notably helpful in the development of valgrind itself.<br>
&gt; [3] </font></tt><a href="http://www.coverity.com/products/quality-advisor.html"><tt><font size=2>http://www.coverity.com/products/quality-advisor.html</font></tt></a><tt><font size=2><br>
</font></tt>
<br>
<br><tt><font size=2>I'm having pretty good success with PyCharm from JetBrains.
&nbsp;Nothing will ever be as good as those for statically typed languages,
but it's darned good at catching all sorts of things prior to run-time.
&nbsp;My python code has improved in reliability significantly thanks to
PyCharm. &nbsp;I've never been much of an IDE person in the past, but this
tool has convinced me that they do have their uses. &nbsp;I focus far more
on the goal now.</font></tt>
<br>
<br><font size=2 face="sans-serif"><br>
--<br>
John Florian</font>
<br>
<br>