| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
The first name will exist until astroid 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.
|
|\ |
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| |
|
| |
|
| |
|
| |
|
| |
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The cleanup consisted in a couple of changes:
* import only modules, not objects, in order
to not clutter the module namespace and to not
leak accidentally objects which aren't public API
for the said modules.
* use two spaces between module level functions
* move some mixins from astroid.node_classes in
the proper order, starting at the left,
not being last in the MRO.
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Until now, the transforms were applied at the same time the tree was
being built. This was problematic if the transform functions were
using inference, since the inference was executed on a partially
constructed tree, which led to failures when post-building
information was needed (such as setting the _from_names
for the From imports).
Now there's a separate step for transforms, which are applied
using transform.TransformVisitor.
There's a couple of other related changes:
* astroid.parse and AstroidBuilder gained a new parameter
`apply_transforms`, which is a boolean flag, which will
control if the transforms are applied. We do this because
there are uses when the vanilla tree is wanted, without
any implicit modification.
* the transforms are also applied for builtin modules,
as a side effect of the fact that transform visiting
was moved in AstroidBuilder._post_build from
AstroidBuilder._data_build.
Closes issue #116.
|
| | |
|
|\ \
| |/
|/| |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
I corrected the spelling of 'infered' to 'infered' and changed some to
make them more consistent with the built-in ast module and to read
better in English. I created aliases with proxy objects to maintain
backwards compatibility.
I also refactored the node classes so that they have __init__ and
postinit functions. The postinit function has to be called after the
creation of a parent with the instances of its children because the
node __init__ functions have to take a parent instance to maintain the
doubly-linked structure of the AST. This involved moving considerable
amounts of node-construction logic from rebuilder.py to
node_classes.py and scoped_nodes.py.
|
| | |
|
|/
|
|
|
| |
We moved astroid.manager.Project and astroid.manager.Manager.project_from_files
to pyreverse.inspector.
|
|
|
|
| |
pylintrc.
|
|
|
|
|
|
|
| |
The new option, 'optimize_ast', controls if peephole optimizer should be enabled or not.
This prevents a regression, where the visit_binop method wasn't called
anymore with astroid 1.3.5, due to the differences in the resulting AST.
Closes issue #82.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There were two problems until now:
* first, the transformed builtin object was deleting during clear_cache,
leaving the next tests to use the untransformed tests, which yielded
InferenceErrors.
* after the first problem was fixed, another problem with CONST_PROXY
occurred, since it was creating a new builtins object, without
the builtins transformations applied, which was used for creating
the const classes. The problem was that even replacing the
builtins instance in astroid_cache, InferenceErrors occurred,
because the const classes were already built and they were referencing
the untransformed builtins. That's why _astroid_bootstrapping
allows to receive a new builtins object, which is passed
properly by the tests.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
and use the functionality in brain/py2gi.
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
never load any compiled Python files.
Fixes pylint issue #347.
|
|
python setup.py develop now works.
|