| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
import is trying to access something beyond the top-level package.
|
|
|
|
| |
removed in 2.0.
|
|
|
|
|
|
|
|
| |
They are subclasses of AstroidBuildingException and are raised when
a module can't be imported from various reasons.
Also do_import_module lets the errors to bubble up without converting
them to InferenceError. This particular conversion happens only during
the inference.
|
|\ |
|
| |\ |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
* Use explicit StopIteration to pass information from generators to
raise_if_nothing_inferred and path_wrapper, rather than return or
implicit termination by reaching the end of the code block.
* Remove remove_nodes in favor of handling the cases in local_attr,
istance_attr, and getattr, to avoid the need for complicated
information passing when needing to raise an exception.
|
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Major changes:
* AstroidError has an __init__ that accepts arbitrary keyword-only
arguments for adding information to exceptions, and a __str__ that
lazily uses exception attributes to generate a message. The first
positional argument to an exception is assigned to .message. The new
API should be fully backwards compatible in general.
* Some exceptions are combined or renamed; the old names are still
available.
* The OperationErrors used by pylint are now BadOperationMessages and
located in util.py.
* The AstroidBuildingException in _data_build stores the SyntaxError
in its .error attribute rather than args[0].
* Many places where exceptions are raised have new, hopefully more
useful error messages.
The only major issue remaining is how to propagate information into decorators.
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is accomplished with two types of modifications:
* implementing dispatch functions on virtual base classes,
which removes entirely the need of monkey-patching
of node classes's methods.
* since some of the functions in protocols.py needed to create new
nodes, we injected the node_classes module into the dispatched
function when calling it, which is a nice use case of dependency injection.
This commit also includes new exceptions, which might be raised whenever
trying to access a capability, with a dispatch function, on a node which
does not support it.
|
| |
|
|
|
|
|
|
|
|
|
| |
augmented assignments.
The change is similar to what was added for UnaryOps: a new method
called *type_errors* for both AugAssign and BinOp, which can be used
to retrieve type errors occurred during inference. Also, a new
exception object was added, BinaryOperationError.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
operations.
In exceptions, one object was added for holding information about a possible
UnaryOp TypeError, object called `UnaryOperationError`. Even though the name
suggests it's an exception, it's actually not one. When inferring UnaryOps,
we use this special object to mark a possible TypeError,
object which can be interpreted by pylint in order to emit a new warning.
We are also exposing a new method for UnaryOps, called `type_errors`,
which returns a list of UnaryOperationsError.
|
|
|
|
| |
raised when there's a problem with any argument of the super call (invalid types).
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
DuplicateBasesError is emitted when duplicate bases are found in a class,
InconsistentMroError is raised when the method resolution is determined
to be inconsistent. They share a common class, MroError, which
is a subclass of ResolveError, meaning that this change is backwards compatible.
|
|
python setup.py develop now works.
|