diff options
| author | Sylvain Thénault <sylvain.thenault@logilab.fr> | 2009-11-23 14:33:47 +0100 |
|---|---|---|
| committer | Sylvain Thénault <sylvain.thenault@logilab.fr> | 2009-11-23 14:33:47 +0100 |
| commit | 3354f2df804360b4a58fe4c4aa84980b3deeab5d (patch) | |
| tree | 7e18f61b8ea69d16c2c408e77005306a47455d6c /utils.py | |
| parent | a08a442fa924f94e2007552e91adae16d300b946 (diff) | |
| parent | 15e7aad2d0ca47b8d8c3b56d6fef327d3b295e5c (diff) | |
| download | astroid-git-3354f2df804360b4a58fe4c4aa84980b3deeab5d.tar.gz | |
merge
Diffstat (limited to 'utils.py')
| -rw-r--r-- | utils.py | 22 |
1 files changed, 4 insertions, 18 deletions
@@ -24,21 +24,6 @@ __docformat__ = "restructuredtext en" from logilab.astng._exceptions import IgnoreChild -def extend_class(original, addons): - """add methods and attribute defined in the addons class to the original - class - """ - brain = addons.__dict__.copy() - for special_key in ('__doc__', '__module__', '__dict__'): - if special_key in addons.__dict__: - del brain[special_key] - try: - original.__dict__.update(brain) - except AttributeError: - # dictproxy object - for k, v in brain.iteritems(): - setattr(original, k, v) - class ASTVisitor(object): """Abstract Base Class for Python AST Visitors. @@ -224,7 +209,9 @@ class ASTVisitor(object): """dummy method for visiting an Yield node""" -REDIRECT = {'Attribute': 'Getattr', +REDIRECT = {'arguments': 'Arguments', + 'Attribute': 'Getattr', + 'comprehension': 'Comprehension', 'Call': 'CallFunc', 'ClassDef': 'Class', "ListCompFor": 'Comprehension', @@ -351,6 +338,5 @@ class LocalsVisitor(ASTWalker): if methods[1] is not None: return methods[1](node) -__all__ = ('REDIRECT', 'LocalsVisitor', 'ASTWalker', 'ASTVisitor', - 'extend_class') +__all__ = ('REDIRECT', 'LocalsVisitor', 'ASTWalker', 'ASTVisitor',) |
