summaryrefslogtreecommitdiff
path: root/astroid/nodes.py
diff options
context:
space:
mode:
authorClaudiu Popa <pcmanticore@gmail.com>2015-10-06 01:22:55 +0300
committerClaudiu Popa <pcmanticore@gmail.com>2015-10-06 01:22:55 +0300
commit5c35c918a6a4b60f8dc89003d4ec14f825d8d59e (patch)
treeae81daedf94482627ac17fc9e4dfc95c9917cf69 /astroid/nodes.py
parent53785b760b4da1371475af082485e636a8d1f573 (diff)
downloadastroid-git-5c35c918a6a4b60f8dc89003d4ec14f825d8d59e.tar.gz
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.
Diffstat (limited to 'astroid/nodes.py')
-rw-r--r--astroid/nodes.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/astroid/nodes.py b/astroid/nodes.py
index 67522e04..2fd6cb65 100644
--- a/astroid/nodes.py
+++ b/astroid/nodes.py
@@ -47,7 +47,9 @@ from astroid.node_classes import (
const_factory,
AsyncFor, Await, AsyncWith,
# Backwards-compatibility aliases
- Backquote, Discard, AssName, AssAttr, Getattr, CallFunc, From
+ Backquote, Discard, AssName, AssAttr, Getattr, CallFunc, From,
+ # Node not present in the builtin ast module.
+ DictUnpack,
)
from astroid.scoped_nodes import (
Module, GeneratorExp, Lambda, DictComp,
@@ -66,7 +68,7 @@ ALL_NODE_CLASSES = (
Repr, BinOp, BoolOp, Break,
Call, ClassDef, Compare, Comprehension, Const, Continue,
Decorators, DelAttr, DelName, Delete,
- Dict, DictComp, Expr,
+ Dict, DictComp, DictUnpack, Expr,
Ellipsis, EmptyNode, ExceptHandler, Exec, ExtSlice,
For, ImportFrom, FunctionDef,
Attribute, GeneratorExp, Global,
@@ -81,5 +83,5 @@ ALL_NODE_CLASSES = (
TryExcept, TryFinally, Tuple,
UnaryOp,
While, With,
- Yield, YieldFrom
+ Yield, YieldFrom,
)