diff options
author | Emile Anclin <emile.anclin@logilab.fr> | 2010-03-15 14:55:42 +0100 |
---|---|---|
committer | Emile Anclin <emile.anclin@logilab.fr> | 2010-03-15 14:55:42 +0100 |
commit | 7f263c79e19db7cfc39455e9016c33aa30b02db5 (patch) | |
tree | ef33d78cb78ee7298dc33c5b5b2992446c2c7fcd /protocols.py | |
parent | 6a35b89b319a2fe27b3ca8532c72142c0b25ae27 (diff) | |
download | astroid-git-7f263c79e19db7cfc39455e9016c33aa30b02db5.tar.gz |
add FilterStmtsMixin and AssignTypeMixins; use polymorphism
- we put "ass_type" into this mixin and add "_get_filtered_stmts";
- this breaks circular import when trying to remove LookupMixin from scoped_nodes
* * *
step by step use _get_filtered_stmts
--HG--
branch : rebuild
Diffstat (limited to 'protocols.py')
-rw-r--r-- | protocols.py | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/protocols.py b/protocols.py index 9b5c744b..40de339c 100644 --- a/protocols.py +++ b/protocols.py @@ -303,35 +303,3 @@ def with_assigned_stmts(self, node, context=None, asspath=None): nodes.With.assigned_stmts = raise_if_nothing_infered(with_assigned_stmts) -def parent_ass_type(self, context=None): - return self.parent.ass_type() - -nodes.Tuple.ass_type = parent_ass_type -nodes.List.ass_type = parent_ass_type -nodes.AssName.ass_type = parent_ass_type -nodes.AssAttr.ass_type = parent_ass_type -nodes.DelName.ass_type = parent_ass_type -nodes.DelAttr.ass_type = parent_ass_type - -def end_ass_type(self): - return self - -# XXX if you add ass_type to a class, you should probably modify -# lookup.LookupMixIn.filter_stmts around line :: -# -# if ass_type is mystmt and not isinstance(ass_type, (nodes.Class, ...)): -nodes.Arguments.ass_type = end_ass_type -nodes.Assign.ass_type = end_ass_type -nodes.AugAssign.ass_type = end_ass_type -nodes.Class.ass_type = end_ass_type -nodes.Comprehension.ass_type = end_ass_type -nodes.Delete.ass_type = end_ass_type -nodes.ExceptHandler.ass_type = end_ass_type -nodes.For.ass_type = end_ass_type -nodes.From.ass_type = end_ass_type -nodes.Function.ass_type = end_ass_type -nodes.Import.ass_type = end_ass_type -nodes.With.ass_type = end_ass_type - - - |