summaryrefslogtreecommitdiff
path: root/astroid/exceptions.py
diff options
context:
space:
mode:
authorClaudiu Popa <cpopa@cloudbasesolutions.com>2015-05-28 12:10:00 +0300
committerClaudiu Popa <cpopa@cloudbasesolutions.com>2015-05-28 12:10:00 +0300
commit719515b4246e43e7238f80fa79869bc514faf15a (patch)
tree0172c659eda69cbfd66975a29b77a6590d32a3e0 /astroid/exceptions.py
parent5c2bdbb44c6092ca31f9924592ef8dc9ef1ed083 (diff)
downloadastroid-git-719515b4246e43e7238f80fa79869bc514faf15a.tar.gz
Add a new *inference object* called Super
This patch also adds support for understanding super calls. astroid understands the zero-argument form of super, specific to Python 3, where the interpreter fills itself the arguments of the call. Also, we are understanding the 2-argument form of super, both for bounded lookups (super(X, instance)) as well as for unbounded lookups (super(X, Y)), having as well support for validating that the object-or-type is a subtype of the first argument. The unbounded form of super (one argument) is not understood, since it's useless in practice and should be removed from Python's specification. Closes issue #89.
Diffstat (limited to 'astroid/exceptions.py')
-rw-r--r--astroid/exceptions.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/astroid/exceptions.py b/astroid/exceptions.py
index d1094cec..9e3a279f 100644
--- a/astroid/exceptions.py
+++ b/astroid/exceptions.py
@@ -42,6 +42,10 @@ class InconsistentMroError(MroError):
"""Error raised when a class's MRO is inconsistent."""
+class SuperError(ResolveError):
+ """Error raised when there is a problem with a super call."""
+
+
class NotFoundError(ResolveError):
"""raised when we are unable to resolve a name"""