-
Francis Herne authored
Make unpacking in assignments handle unsure-types (unpack all suitable types and combine the results). ``` a = 1, 2, 3 a = ["a", "b", "c"] x, y, z = a # 'unsure (int, str)' rather than 'mixed'. ``` Reimplement visitFor() and visitComprehension() to use the assignment code, which has better unpacking support and saves a lot of lines. For-loops and comprehensions now get a type when used on tuples: `for x in 1, 2, 3: pass # 'int'` ...and support nested and PEP-3132 unpacking: ``` for first, *middle, (a, b) in [(1, 2, 3, (4, 5))]: pass # middle: 'list of int', a: 'int' ``` BUG: 359915 Iterating over dicts now gets the key type rather than values. Fixes one previously-XFAIL test, adds a few more. No known regressions. Differential Revision: https://phabricator.kde.org/D3352
69177a77