Closed pylint-bot closed 8 years ago
Original comment by BitBucket: cezarelnazli, GitHub: cezarelnazli:
Are there any other cases where None might appear? Would a possible solution look something like if Pair[0][i] is None: Pair[0].remove(i); Pair[0].insert(i, Pair[1][i].keys())
? Would something like this work for nested dicts as well ({'x': 1, **{'y': 2, **{'z': 3}}}
)?
Original comment by Claudiu Popa (BitBucket: PCManticore, GitHub: PCManticore):
Add a new node, DictUnpack, for representing the unpacking of a dict using PEP 448
This is a different approach than what the builtin ast module does, since it just uses None to represent this kind of operation, which seems conceptually wrong, due to the fact the AST contains non-AST nodes. Closes issue #206.
Original comment by Claudiu Popa (BitBucket: PCManticore, GitHub: PCManticore):
Cezar, I don't know, hopefully this was the only place where this occurred. I fixed it by adding a new node, since it seems that the builtin ast module does some things conceptually wrong (putting None as an AST node).
Original comment by Claudiu Popa (BitBucket: PCManticore, GitHub: PCManticore):
Add a new node, DictUnpack, for representing the unpacking of a dict using PEP 448
This is a different approach than what the builtin ast module does, since it just uses None to represent this kind of operation, which seems conceptually wrong, due to the fact the AST contains non-AST nodes. Closes issue #206.
Originally reported by: Claudiu Popa (BitBucket: PCManticore, GitHub: PCManticore)
Given this code
{'x': 1, **{'y': 2}}
, astroid fails with the following tracebackThis happens because the dictionary is represented as a pair of keys and values in the form (['x', None], [1, {'y', 2}]) and astroid considers that each component is an AST node.