| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
Essentially implement the getitem method in ClassDef which returns the correct value.
Fixes #348
|
| |
|
|
|
|
| |
Format strings require support for two new nodes, FormattedValue, respectively JoinedStr.
|
|
|
|
| |
raising TypeError and letting the upper context to handle it.
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
providing a way to access the attributes of the latter seamlessly.
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If a node had a .fromlineno as None, then a function would be invoked
which retrieved the first line number of the children or the parents which
wasn't none. This is wrong, because it's not a guarantee that all nodes should
have it set, especially those coming from raw_building, where it can be close
to impossible to determine the line number of an object coming from an
extension module. The functionality was removed and certain guards
were added in a couple of places in order to protect operations against
None.
Close #310 and #195
|
| |
|
| |
|
|
|
|
| |
in rebuilder
|
|
|
|
|
|
|
|
|
|
|
|
| |
When looking up a name in a scope, Scope.lookup will return
only the values which will be reachable after execution, as seen
in the following code:
a = 1
a = 2
In this case it doesn't make sense to return two values, but
only the last one.
|
| |
|
| |
|
|
|
|
| |
3 With node.
|
|
|
|
| |
corresponding to the stdlib Compare node.
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
Close #300
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
do_import_module was broken for Import, since it was relying on a
missing attribute `modname`. do_import_module
in fact required all the time for a name parameter to be
passed as an argument. The inherent problem is that
Import doesn't have an underlying module name, but more of them,
in the .names attribute. Thus requiring for do_import_module to
pick one name from .names or to return multiple modules was
deemed inappropiate and the method became a function which
always requires the import name to be given.
do_import_module and real_name are now functions in interpreter.util.
Closes #293
|
|
|
|
|
|
|
|
| |
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.
|