<table><tr><td style="">flherne created this revision.<br />Restricted Application added a subscriber: kdevelop-devel.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D6949" rel="noreferrer">View Revision</a></tr></table><br /><div><strong>REVISION SUMMARY</strong><div><p>This causes the correct declaration to be found in some unusual cases that previously failed.</p>

<ul class="remarkup-list">
<li class="remarkup-list-item">Names can be used in a function body before their definition, provided that they're defined before the function is called. These weren't found unless declared at module scope.</li>
</ul>

<p>BUG: 378083</p>

<ul class="remarkup-list">
<li class="remarkup-list-item">Class attributes from any enclosing class definition were found in default arguments. Only those from a method's parent class should be found.</li>
</ul>

<ul class="remarkup-list">
<li class="remarkup-list-item">Class or instance attributes were, correctly, not directly visible inside a method body (only with <tt style="background: #ebebeb; font-size: 13px;">self.</tt> or similar). They did however hide names from outer contexts.</li>
</ul></div></div><br /><div><strong>TEST PLAN</strong><div><p>All existing tests pass.</p>

<p>Add some new tests, of which four previously failed (declaration_order_func_defarg2, intermediate_vs_class/instance_attrs, top_level_vs_nested_*).</p>

<p>Quite a lot of manual testing.</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R53 KDevelop: Python Support</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D6949" rel="noreferrer">https://phabricator.kde.org/D6949</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>duchain/helpers.cpp</div></div></div><br /><div><strong>To: </strong>flherne, brauch<br /><strong>Cc: </strong>kdevelop-devel<br /></div>