| Commit message (Collapse) | Author | Age | Files | Lines |
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
| |
with this
|
| | |
|
| |\ |
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
| | | |
|
| | |
| |
| |
| | |
enough to find some bugs
|
| |/ |
|
| | |
|
| |
|
|
| |
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.
|
| |
|
|
| |
(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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
| |
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.
|
| |
|
|
| |
not exist as a node in the builtin ast module.
|
| | |
|
| | |
|
| | |
|
| |
|
|
| |
print_tree() shortcut method
|
| | |
|
| |
|
|
| |
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.
|
| | |
|