| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
|
|
|
|
|
| |
Essentially implement the getitem method in ClassDef which returns the correct value.
Fixes #348
|
| |
|
| |
|
|
|
|
|
| |
The order is important, since it determines the last child,
which in turn determines the last line number of a scoped node.
|
| |
|
| |
|
|
|
|
|
|
| |
For instance, a module can decide to redefine its __file__ attribute.
Previously, this was defaulting to the file name itself, without taking
in account local redefinitions.
|
| |
|
|
|
|
| |
multiple directories contributing to the same namespace.
|
|
|
|
| |
which is a builtin object (a property)
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
| |
Instead, we're inferring FunctionDefs where an unbound access
to a method was found.
Close #257
|
|
|
|
|
|
|
|
| |
Through this model, astroid starts knowing special attributes of certain Python objects,
such as functions, classes, super objects and so on. This was previously possible before,
but now the lookup and the attributes themselves are separated into a new module,
objectmodel.py, which describes, in a more comprehensive way, the data model of each
object.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Our understanding of wildcard imports through __all__ was
half baked to say at least, since we couldn't account for
modifications of the list, which results in tons of false positives.
Instead, we replaced it with public_names(), a method which returns
all the names that are publicly available in a module, that is that
don't start with an underscore, even though this means that there
is a possibility for other names to be leaked out even though
they are not present in the __all__ variable.
Close #322
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The old way consisted in having the parameter names, their
defaults and their annotations separated in different components
of the Arguments node. We introduced a new Param node, which holds
the name of a parameter, its default value and its annotation.
If any of the last two values are missing, then that slot will be
filled with a new node kind, Empty, which is used for specifying the
lack of something (None could have been used instead, but that means having
non-AST nodes in the Arguments node).
We're also having support for positional only arguments, for the moment
only in raw_building.
Close #215
|
|
|
|
|
|
|
|
| |
Dict was a bit different that the corresponding class from the
builtin ast module with respect to how it was initialized.
Instead of accepting a list of pairs, the initializer accepts
two arguments, one for keys, the other for values. For backward
compatibility, the class gained a new .items property.
|
|
|
|
|
|
| |
This means that checks such as ``isinstance(node, Lambda)`` will not
hold true anymore for Functions.
Closes #291
|
| |
|
|
|
|
| |
module stream.
|
|
|
|
|
|
| |
The mixins are better off in tree.base, rather than having their
own module. They are also used only by the AST nodes.
Close #292
|
|
|
|
|
|
|
|
| |
The new mixin is used by ClassDef, Lambda, FunctionDef and Module,
for defining a qname() method on them. This should fix a bug where
the qname was defined on any subclass of LocalsDictNode, even though
it wasn't possible to get a qualified name for the node in question.
Closes #278.
|
|
|
|
|
|
|
|
|
|
|
| |
This patch moves code which was targeted for implementing
lookup support from scoped_nodes into interpreter.lookup,
resulting in a more cohesive scoped_nodes module. The lookup functions
were capable of using virtual base classes instead on relying on concrete
classes offered by node_classes and scoped_nodes. The only minor complaint
is that builtin_lookup still needs to depend on the manager, which is
lazily loaded inside the function itself, at least until we'll get rid
of this circular dependency.
|
|
|
|
| |
NotImplementedError.
|
|
|
|
| |
(will fail for old style classes)
|
|
|
|
|
|
|
|
| |
current and parent slots.
We're doing this because this is the right semantics of slots,
they get inherited, as long as each parent defines a __slots__
entry.
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
extrinsic names in mock ASTs
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Add comment and memoization to the lazy instance in raw_building.
* Work around obscure pylib/apipkg issue.
* Add a skip to numpy test that's not terminating on Python 2.
* Fix module special attributes.
* Make errors for old-style classes in mro() TypeErrors, not
NotImplementedErrors.
* Add special nodes to treeabc.
* Add {posargs} to tox.ini to enable passing -v to unittest.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
nodes anymore.
|
|
|
|
|
| |
The returned CallSite object can be used to pair arguments with function's
parameters.
|
| |
|
|
|
|
| |
more amenable to changes.
|