&gt; For what’s it worth, Python 3 gets it right:
&gt; ...
&gt; Also, would you expect hasattr() to raise that error?<p>Not really no. I would expect hasattr() to just answer whether the attribute exists, and getattr() to actually invoke it. If &quot;hasattr&quot; actually invokes the attribute and just checks for a non-empty value returned, is it even needed? It would completely surprise me, coming from a language with static types + reflection, that a query for a types attributes (mere existence) would invoke them.