diff options
author | Claudiu Popa <cpopa@cloudbasesolutions.com> | 2015-05-28 12:10:00 +0300 |
---|---|---|
committer | Claudiu Popa <cpopa@cloudbasesolutions.com> | 2015-05-28 12:10:00 +0300 |
commit | 719515b4246e43e7238f80fa79869bc514faf15a (patch) | |
tree | 0172c659eda69cbfd66975a29b77a6590d32a3e0 /astroid/exceptions.py | |
parent | 5c2bdbb44c6092ca31f9924592ef8dc9ef1ed083 (diff) | |
download | astroid-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.py | 4 |
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""" |