diff options
author | Claudiu Popa <pcmanticore@gmail.com> | 2018-06-15 09:37:40 +0200 |
---|---|---|
committer | Claudiu Popa <pcmanticore@gmail.com> | 2018-06-15 09:37:40 +0200 |
commit | 76836190096be94ab30c7f7fe4d988e9e374d397 (patch) | |
tree | 2f9173e4e56232aebc7a46d43ef442ea5d2169d7 /astroid/protocols.py | |
parent | fab4f207d48570e941a1df4b6441ba2ca12efbe5 (diff) | |
download | astroid-git-76836190096be94ab30c7f7fe4d988e9e374d397.tar.gz |
Use postinit() to initialize the list generated by a Starred node
Diffstat (limited to 'astroid/protocols.py')
-rw-r--r-- | astroid/protocols.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/astroid/protocols.py b/astroid/protocols.py index 68d61e97..63be7101 100644 --- a/astroid/protocols.py +++ b/astroid/protocols.py @@ -14,6 +14,7 @@ import collections import operator as operator_mod import sys +from astroid import Store from astroid import arguments from astroid import bases from astroid import context as contextmod @@ -604,10 +605,15 @@ def starred_assigned_stmts(self, node=None, context=None, asspath=None): elts.pop() continue # We're done - packed = nodes.List() - packed.elts = elts - packed.parent = self + packed = nodes.List( + ctx=Store, + parent=self, + lineno=lhs.lineno, + col_offset=lhs.col_offset, + ) + packed.postinit(elts=elts) yield packed break + nodes.Starred.assigned_stmts = starred_assigned_stmts |