Law of Demeter and Python
<p>Is there a tool to check if a Python code conforms to the law of Demeter?</p>

<p>I found a mention of Demeter in pychecker, but it seems that the tool understands this law different to what I expect: <a href="http://en.wikipedia.org/wiki/Law_of_Demeter" rel="nofollow">http://en.wikipedia.org/wiki/Law_of_Demeter</a></p>

<p>The definition from wikipedia: the Law of Demeter for functions requires that a method M of an object O may only invoke the methods of the following kinds of objects:</p>

<ol>
<li>O itself</li>
<li>M's parameters</li>
<li>any objects created/instantiated within M</li>
<li>O's direct component objects</li>
<li>a global variable, accessible by O, in the scope of M</li>
</ol>
