&gt; I can see the value in quickly knowing if new code is mucking with private&#x2F;protected properties.<p>Would this do it?<p><pre><code>    re.findall(r&#x27;(?&lt;!self)\._\w+&#x27;, sourcelines)
</code></pre>
Anytime you&#x27;re using ``obj._foo`` and it&#x27;s not ``self._foo`` that suggests you&#x27;re mucking about with the internals of an object that the author didn&#x27;t expect you to use.