summaryrefslogtreecommitdiff
path: root/astroid/nodes.py
diff options
context:
space:
mode:
authorCeridwen <ceridwenv@gmail.com>2015-07-13 22:03:34 -0400
committerCeridwen <ceridwenv@gmail.com>2015-07-13 22:03:34 -0400
commit42c584aa47ff89310744b280336714ab0c39092d (patch)
tree3cba21ea9910a1053fcee42bfd108e32ea9acd87 /astroid/nodes.py
parent94520560b047a12b5e277fd73400491e8dc1172d (diff)
downloadastroid-git-42c584aa47ff89310744b280336714ab0c39092d.tar.gz
Move proxies to nodes.py and scoped_nodes.py
Diffstat (limited to 'astroid/nodes.py')
-rw-r--r--astroid/nodes.py27
1 files changed, 6 insertions, 21 deletions
diff --git a/astroid/nodes.py b/astroid/nodes.py
index 07fe8594..820a8d49 100644
--- a/astroid/nodes.py
+++ b/astroid/nodes.py
@@ -38,8 +38,6 @@ on ImportFrom and Import :
__docformat__ = "restructuredtext en"
-import lazy_object_proxy
-
from astroid.node_classes import (
Arguments, AssignAttr, Assert, Assign,
AssignName, AugAssign, Repr, BinOp, BoolOp, Break, Call, Compare,
@@ -48,14 +46,19 @@ from astroid.node_classes import (
ImportFrom, Attribute, Global, If, IfExp, Import, Index, Keyword,
List, Name, Nonlocal, Pass, Print, Raise, Return, Set, Slice, Starred, Subscript,
TryExcept, TryFinally, Tuple, UnaryOp, While, With, Yield, YieldFrom,
- const_factory
+ const_factory,
+ # Backwards-compatibility aliases
+ Backquote, Discard, AssName, AssAttr, Getattr, CallFunc, From
)
from astroid.scoped_nodes import (
Module, GeneratorExp, Lambda, DictComp,
ListComp, SetComp, FunctionDef, ClassDef,
+ # Backwards-compatibility aliases
+ Class, Function, GenExpr,
)
+
ALL_NODE_CLASSES = (
Arguments, AssignAttr, Assert, Assign, AssignName, AugAssign,
Repr, BinOp, BoolOp, Break,
@@ -78,21 +81,3 @@ ALL_NODE_CLASSES = (
While, With,
Yield, YieldFrom
)
-
-
-# Backward-compatibility aliases
-def proxy_alias(alias_name, node_type):
- proxy = type(alias_name, (lazy_object_proxy.Proxy,),
- {'__class__': object.__dict__['__class__']})
- return proxy(lambda: node_type)
-
-Backquote = proxy_alias('Backquote', Repr)
-Discard = proxy_alias('Discard', Expr)
-AssName = proxy_alias('AssName', AssignName)
-AssAttr = proxy_alias('AssAttr', AssignAttr)
-Getattr = proxy_alias('Getattr', Attribute)
-CallFunc = proxy_alias('CallFunc', Call)
-Class = proxy_alias('Class', ClassDef)
-Function = proxy_alias('Function', FunctionDef)
-GenExpr = proxy_alias('GenExpr', GeneratorExp)
-From = proxy_alias('From', ImportFrom)