https://bugs.kde.org/show_bug.cgi?id=359914

Sven Brauch <m...@svenbrauch.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |FIXED
      Latest Commit|                            |http://commits.kde.org/kdev
                   |                            |-python/6b81441e0db9a7c34dc
                   |                            |cc627cf99c0785a00afed

--- Comment #1 from Sven Brauch <m...@svenbrauch.de> ---
Git commit 6b81441e0db9a7c34dccc627cf99c0785a00afed by Sven Brauch, on behalf
of Francis Herne.
Committed on 02/06/2016 at 20:41.
Pushed by brauch into branch '5.0'.

Adds support for PEP-3132 'Extended Iterable Unpacking'

Support assignments of the form a, *b, c = 1, 2, 3, 4, 5,
after which b is [2, 3, 4].
Related: bug 362521
Differential revision: https://phabricator.kde.org/D1751

Fix assignments of the form a = b = 7, a = b = 3, 4.

Fix assignment from a single-element tuple:
 foo = (3,) makes foo a tuple, not int.
Fix unpacking into a single-element tuple:
 foo, = [7] makes foo an int, not a list.

Fix unpacking of nested tuples: foo, (bar, baz) = 2, ('a', 5.5).

Declaration aliasing works for simple "a = b" assignment, e.g.

def aaa(a: int):
    return "a"
bbb = aaa

It _doesn't_ work for anything more advanced, e.g.

def aaa(a: int):
    return "a"
bbb, ccc = aaa, 4

although the function type is preserved.

This is a regression, aliasing works for non-nested tuple assignment
without this patch. The use case is however questionable and the benefit
of these changes is certainly more valuable.

M  +86   -104  duchain/declarationbuilder.cpp
M  +12   -15   duchain/declarationbuilder.h
M  +27   -2    duchain/tests/pyduchaintest.cpp

http://commits.kde.org/kdev-python/6b81441e0db9a7c34dccc627cf99c0785a00afed

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to