| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
| |
The runtime objects from astroid.bases and astroid.objects got
merged together into astroid.runtime.objects. bases._infer_stmts
was moved into a new namespace, interpreter, which should be
the starting point of a the new abstract interpretation component.
|
|
|
|
|
|
| |
There are two new directories now, runtime and tree, which are
meant to separate between runtime objects, such as Instance, BoundMethod
etc from AST nodes.
|
|
|
|
|
|
|
| |
This commit introduces the concept of virtual bases for the AST
and runtime objects, the idea being that isinstance checks should
be done against these virtual classes, while other operations
need to be done on concrete objects.
|
|
|
|
|
|
|
|
| |
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.
|
| | |
|
| |
| |
| |
| |
| |
| | |
which is `type` on Python 3.
Closes issue #114.
|
| |
| |
| |
| | |
the class that wraps a node.
|
| |
| |
| |
| |
| |
| |
| |
| | |
This also implements an easier @cache decorator and removes @classproperty as
it only was used in an insignificant test.
--HG--
branch : no-logilab-common
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| | |
Added aliases for inferred() and assign_type(), refactor some uses of
ternary if, remove some now-unused internal functions in rebuilder,
replaced the mutating docstring function with one that returns values
as well as side-effects, change back to lazy-object-proxy, and add keyword
args to the Module call in rebuilder.
|
| |
| |
| |
| | |
minor fixes
|
|\ \
| |/ |
|
| | |
|