| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
The first name will exist until astroid 2.0.
|
|
|
|
|
|
|
| |
They used to have different signatures and each one made
assumptions about what could be passed to other implementations,
leading to various possible crashes when one or more arguments
weren't given. Closes issue #277.
|
|\ |
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* 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.
|
|\ \ |
|
| |/ |
|
|/
|
|
|
|
|
|
|
|
|
| |
testing.
* Rename YES to Uninferable
* Rename instanciate_class to instantiate_class.
* Use six in test_namedtuple_advanced_inference.
* Fix test_file_from_module failure on PyPy.
* Add enum34 to unittest_brain.
* Add unittest_brain dependencies tox.ini.
|
|
|
|
|
|
|
|
| |
Also, Class.getattr('__bases__') returns actual bases.
It previously didn't work correctly, because it was putting the
entire ancestors into the Tuple object and it put those classes
into the wrong attribute.
Closes issue #128.
|
| |
|
| |
|
|
|
|
|
|
| |
We're doing this in order to reduce the dependency hell which
occurs when a module such as bases.py wants to use classes
defined in node_classes.
|
|
|
|
| |
level assignments to the same name as decorator calls.
|
|\
| |
| |
| | |
Use six.reraise to avoid losing tracebacks for simple cases
|
| | |
|
| | |
|
|/
|
|
| |
an attribute.
|
|\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This patch adds __str__` and `__repr__` methods to InferenceContext and
alters the `__str__, `__repr__, and repr_tree() methods for NodeNG.
The `__str__` methods print out formatted information about the object's
fields; NodeNG's `__str__` method is not recursive. InferenceContext's
__repr__` gives a compact representation of its fields. I slightly
shortened NodeNG's `__repr__` method by removing a field that's usually
empty. I rewrote repr_tree() to better format the information it
contains and to display *all* the fields for each AST node, with some
fields controlled by options to avoid spam. I also fixed
https://bitbucket.org/logilab/astroid/issues/185/as_string-gives-wrong-result-for-keyword .
|
| | |
|
| | |
|
|/ |
|
|\
| |
| |
| | |
Improve decorator introspection using wrapt and functools.wraps.
|
| | |
|
| |\
| | |
| | |
| | | |
Fix infinite loop in metaclass inference
|
| | | |
|
| | | |
|
|/ / |
|
| |
| |
| |
| | |
before the actual roots.
|
| | |
|
| |
| |
| |
| | |
messages.
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
|\ \
| |/ |
|
| |
| |
| |
| |
| |
| |
| | |
In order to reduce circular dependencies between components,
CallContext is moved into a new module, astroid.context.
At the same time, for increasing the cohesion inside astroid.bases,
InferenceContext was moved as well into astroid.context.
|
| | |
|
| |
| |
| |
| | |
expectancy of a static analysis tool.
|
| | |
|
| |
| |
| |
| |
| |
| |
| | |
YES is needed by other components of astroid, components which aren't
necessarily related to astroid.bases. In order to reduce circular
interdependencies between components, YES is moved into a new module,
tailored for various *utilities*.
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Function.extra_decorators.
Previously, the extra_decorators computation was done in the rebuilder,
which isn't the proper way to do it, since the rebuilder should be
responsible only from transforming vanilla ast trees to astroid trees.
Now, Function exports a propery called `extra_decorators`, which computes
at runtime the callables that are wrapping a function in a class scope.
|
| |
| |
| |
| | |
Closes issue #162.
|
| |
| |
| |
| |
| |
| |
| |
| | |
Class.declared_metaclass.
Class.mro remains the de facto method for retrieving the metaclass
of a class, which will also do an evaluation of what declared_metaclass
returns.
|
| | |
|