summaryrefslogtreecommitdiff
path: root/utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'utils.py')
-rw-r--r--utils.py25
1 files changed, 13 insertions, 12 deletions
diff --git a/utils.py b/utils.py
index 664cb6d8..83ef2f89 100644
--- a/utils.py
+++ b/utils.py
@@ -24,20 +24,21 @@ __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
+def extend_class(original, class_addons):
+ """add methods and attribute defined in the addon classes 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)
+ for addons in class_addons:
+ 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):