diff options
author | Ceridwen <ceridwenv@gmail.com> | 2015-08-21 12:30:06 -0400 |
---|---|---|
committer | Ceridwen <ceridwenv@gmail.com> | 2015-08-21 12:30:06 -0400 |
commit | cac27b433c9342a1f978278a165864f7e3f1f546 (patch) | |
tree | 459587853d073a9e33796a3b444a667934007b10 /astroid/scoped_nodes.py | |
parent | d59fbbd2b15169d59714564935252cea7b57ec7c (diff) | |
download | astroid-cac27b433c9342a1f978278a165864f7e3f1f546.tar.gz |
Add tests for aliases
Diffstat (limited to 'astroid/scoped_nodes.py')
-rw-r--r-- | astroid/scoped_nodes.py | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/astroid/scoped_nodes.py b/astroid/scoped_nodes.py index 7a312bb..4e2c31f 100644 --- a/astroid/scoped_nodes.py +++ b/astroid/scoped_nodes.py @@ -1342,14 +1342,16 @@ class ClassDef(bases.Statement, LocalsDictNodeNG, mixins.FilterStmtsMixin): """Get an attribute from this class, using Python's attribute semantic This method doesn't look in the instance_attrs dictionary - since it's done by an Instance proxy at inference time. - It may return a YES object if the attribute has not been actually + since it's done by an Instance proxy at inference time. It + may return a YES object if the attribute has not been actually found but a __getattr__ or __getattribute__ method is defined. - If *class_context* is given, then it's considered that the attribute - is accessed from a class context, e.g. Class.attribute, otherwise - it might have been accessed from an instance as well. - If *class_context* is used in that case, then a lookup in the - implicit metaclass and the explicit metaclass will be done. + If *class_context* is given, then it's considered that the + attribute is accessed from a class context, + e.g. ClassDef.attribute, otherwise it might have been accessed + from an instance as well. If *class_context* is used in that + case, then a lookup in the implicit metaclass and the explicit + metaclass will be done. + """ values = self.locals.get(name, []) if name in self.special_attributes: @@ -1395,7 +1397,7 @@ class ClassDef(bases.Statement, LocalsDictNodeNG, mixins.FilterStmtsMixin): return for attr in bases._infer_stmts(attrs, context, frame=cls): - if not isinstance(attr, Function): + if not isinstance(attr, FunctionDef): yield attr continue |