<table><tr><td style="">flherne created this revision.<br />flherne added a reviewer: brauch.<br />flherne set the repository for this revision to rKDEVPYTHON KDev-python.<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/D1751" rel="noreferrer">View Revision</a></tr></table><br /><div><strong>REVISION SUMMARY</strong><div><p>Adds support for <a href="https://www.python.org/dev/peps/pep-3132/" class="remarkup-link" target="_blank" rel="noreferrer">PEP-3132 'Extended Iterable Unpacking'</a>, fix several other bugs, and add tests for these.</p>

<p>Support assignments of the form "a, *b, c = 1, 2, 3, 4, 5", after which b is [2, 3, 4].<br />
BUG: <a href="https://bugs.kde.org/show_bug.cgi?id=362521" class="remarkup-link" target="_blank" rel="noreferrer">https://bugs.kde.org/show_bug.cgi?id=362521</a></p>

<p>Fix assignments of the form "a = b = 7",  "a = b = 3, 4".</p>

<p>Fix assignment from a single-element tuple: "foo = (3,)" makes`foo` a tuple, not int.<br />
Fix unpacking into a single-element tuple: "foo, = [7]" makes <tt style="background: #ebebeb; font-size: 13px;">foo</tt> an int, not a list.</p>

<p>Fix unpacking of nested tuples: "foo, (bar, baz) = 2, ('a', 5.5)".<br />
BUG: <a href="https://bugs.kde.org/show_bug.cgi?id=359914" class="remarkup-link" target="_blank" rel="noreferrer">https://bugs.kde.org/show_bug.cgi?id=359914</a></p>

<p>Declaration aliasing works for simple "a = b" assignment, e.g.<br />
def aaa(a: int):</p>

<div class="remarkup-code-block" style="margin: 12px 0;" data-code-lang="text" data-sigil="remarkup-code-block"><pre class="remarkup-code" style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; padding: 12px; margin: 0; background: rgba(71, 87, 120, 0.08);">return "a"</pre></div>

<p>bbb = aaa</p>

<p>It _doesn't_ work for anything more advanced, e.g.</p>

<div class="remarkup-code-block" style="margin: 12px 0;" data-code-lang="text" data-sigil="remarkup-code-block"><pre class="remarkup-code" style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; padding: 12px; margin: 0; background: rgba(71, 87, 120, 0.08);">def aaa(a: int):
    return "a"
bbb, ccc = aaa, 4</pre></div>

<p>although the function type is preserved.</p>

<p>This is a regression, aliasing works for non-nested tuple assignment without this patch. Sven told me not to worry about that yet...</p></div></div><br /><div><strong>TEST PLAN</strong><div><p>Typed stuff, compared results with python interpreter output.</p>

<p>Wrote and added some tests.</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>rKDEVPYTHON KDev-python</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D1751" rel="noreferrer">https://phabricator.kde.org/D1751</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>duchain/declarationbuilder.cpp<br />
duchain/declarationbuilder.h<br />
duchain/tests/pyduchaintest.cpp</div></div></div><br /><div><strong>EMAIL PREFERENCES</strong><div><a href="https://phabricator.kde.org/settings/panel/emailpreferences/" rel="noreferrer">https://phabricator.kde.org/settings/panel/emailpreferences/</a></div></div><br /><div><strong>To: </strong>flherne, brauch<br /><strong>Cc: </strong>kdevelop-devel<br /></div>