| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
node was used.
The possible values for the contexts are `Load` ('a'), `Del` ('del a'),
`Store` ('a = 4') and the nodes that got the new attribute are Starred,
Subscript, List and Tuple. The builtin ast module provides contexts for
Name and Attribute as well, but we took a different approach in the past,
by having different nodes for each type of context. For instance, Name
used in a Del context is a DelName, while Name used in a Store
context is AssignName. Since this is ingrained in astroid since quite
some time, it makes no sense to change them as well, even though it's
a loss of consistency.
The patch introduces a new dependency to enum34 on older Python
versions, which is used for building the three possible enum values
for the contexts.
Closes issue #267.
|
|
|
|
| |
import is trying to access something beyond the top-level package.
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
not exist as a node in the builtin ast module.
|
| |
|
|
|
|
|
|
|
| |
to avoid a potential problem with encodings when using .format.
Closes issue #273.
|
|
|
|
|
|
|
|
|
|
| |
Some object, for instance List or Tuple can have, after inference,
Uninferable as their elements, happening when their components
weren't couldn't be inferred properly. This means that as_string
needs to cope with expecting Uninferable nodes part of the other
nodes coming for a string transformation. The patch adds a visit
method in AsString and ``accept`` on Yes / Uninferable nodes.
Closes issue #270.
|
| |
|
| |
|
|\ |
|
| |\ |
|
| | | |
|
| | | |
|
| | |
| | |
| | |
| | | |
only adds noise to the tracebacks on 2.7, and when this code is changed to use yield from, there shouldn't be additional tracebacks on 3 either
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
* 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 can happen for instance when the list contains objects which
weren't inferable in the first place. There were a bunch of places
affected by this bug: unpack_infer, the inference of list additions
and the handling of the namedtuple's fields.
|
| | | |
|
| | | |
|
|/ / |
|
|\ \ |
|
| | | |
|
| |\ \ |
|
| | | | |
|
| |/ /
| | |
| | |
| | | |
using .split() in assignment unpacking.
|
| |\ \ |
|
| | |\ \ |
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
If the current class is a metaclass (inherits from `type`), then
the first argument is always a class, not an instance.
|
|/ / / /
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
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.
|
| | | | |
|
| |/ /
|/| | |
|
|\ \ \
| |/ / |
|
| |/ |
|
|/ |
|
|\ |
|
| | |
|
|/
|
|
| |
actual purpose.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
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.
|
|\
| |
| |
| | |
Fix inference of list multiplication operation.
|
| |
| |
| |
| |
| | |
Now inference yields YES instead of list item value when multiple
values are inferred for one list item.
|