summaryrefslogtreecommitdiff
path: root/astroid/tree
Commit message (Collapse)AuthorAgeFilesLines
* Mark __init_subclass__ as classmethod (#388)2.0.experimental2.0Łukasz Rogalski2017-01-301-0/+3
|
* Different name for kwonlyargs in astroid 2.0Claudiu Popa2017-01-261-2/+2
|
* Let NotSupportedError be propagated.Claudiu Popa2017-01-261-6/+1
|
* Make is_argument search kwonlyargs. (#386)Derek Gustafson2017-01-221-1/+6
|
* Implement __getitem__ inference for classes (using the metaclass)David Euresti2017-01-221-0/+25
| | | | | | Essentially implement the getitem method in ClassDef which returns the correct value. Fixes #348
* Make ClassDefs support keyword arguments. (#384)Derek Gustafson2017-01-222-3/+8
|
* add format string support (#365)Jared Garst2016-12-303-0/+44
| | | | Format strings require support for two new nodes, FormattedValue, respectively JoinedStr.
* Raise AstroidTypeError whenever a slice cannot be inferred, instead of ↵Claudiu Popa2016-12-301-1/+3
| | | | raising TypeError and letting the upper context to handle it.
* Reraise the exceptions as astroid exceptions in .getitem.Claudiu Popa2016-12-301-6/+10
|
* Let the type error propagate as an AstroidTypeError.Claudiu Popa2016-12-301-23/+39
|
* getitem() method accepts nodes now, instead of Python objects.Claudiu Popa2016-12-301-10/+64
|
* Skip the current class when deducing its mro. Close #361.Claudiu Popa2016-11-211-0/+2
|
* Remove infered and instantiate_class from the code baseClaudiu Popa2016-08-241-15/+0
|
* Make InterpreterObjects be used as their underlying runtime object, by ↵Claudiu Popa2016-08-211-4/+18
| | | | providing a way to access the attributes of the latter seamlessly.
* Add `returns` into the proper order in FunctionDef._astroid_fieldsClaudiu Popa2016-07-271-1/+1
| | | | | The order is important, since it determines the last child, which in turn determines the last line number of a scoped node.
* Even more granular copyrights (thanks to copyrite)Claudiu Popa2016-07-226-12/+20
|
* Keep a consistent copyright notice across the board.Claudiu Popa2016-07-196-0/+12
|
* Use the lineno and col_offset provided by variadics in Python 3.5+. Close #335Claudiu Popa2016-06-281-2/+4
|
* Give priority to local special attributes for classes and modulesClaudiu Popa2016-06-051-4/+23
| | | | | | 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.
* Convert all files to new license headerCeridwen2016-05-176-85/+18
|
* Build a dummy module object for namespace directories and add a test for ↵Claudiu Popa2016-05-091-0/+2
| | | | multiple directories contributing to the same namespace.
* Don't crash when a decorated method has the same name as the decorator, ↵Claudiu Popa2016-04-301-1/+9
| | | | which is a builtin object (a property)
* Calling lambda methods (defined at class level) can be understood.Claudiu Popa2016-04-261-1/+6
|
* decoratornames() does not leak InferenceError anymore.Claudiu Popa2016-03-111-2/+5
|
* dict.values, dict.keys and dict.items are properly inferredClaudiu Popa2016-03-061-1/+1
|
* Try to compute descriptors only for objects with the source code available.Claudiu Popa2016-03-011-5/+12
|
* Unbound methods don't occur anymore on Python 3Claudiu Popa2016-02-251-3/+8
| | | | | | | Instead, we're inferring FunctionDefs where an unbound access to a method was found. Close #257
* Introduce a special attributes modelClaudiu Popa2016-02-231-62/+17
| | | | | | | | 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.
* Add a __repr__ for CallSite. Close #209Claudiu Popa2016-02-191-0/+8
|
* imported_names() got replaced by public_names()Claudiu Popa2016-02-181-51/+3
| | | | | | | | | | | | | 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
* Changed the way how parameters are being builtClaudiu Popa2016-02-135-149/+215
| | | | | | | | | | | | | | | 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
* Don't set the fromlineno of parents or children for nodes without it setClaudiu Popa2016-01-252-31/+7
| | | | | | | | | | | | | 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
* NodeNG.nearest was removed.Claudiu Popa2016-01-251-18/+0
|
* Build AsyncWith nodes correctlyCeridwen2016-01-151-3/+3
|
* Fix typos for visit_withitem in as_string, forward visit_asyncwith correctly ↵Ceridwen2016-01-151-1/+1
| | | | in rebuilder
* Enforce strong updates per frames.Claudiu Popa2016-01-121-2/+1
| | | | | | | | | | | | 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.
* Put mixins before NodeNG for WithItemCeridwen2016-01-091-1/+1
|
* Rename asspath to assign_ppathCeridwen2016-01-091-4/+4
|
* Refactor With nodes to have subnodes, WithItems, corresponding to the stdlib ↵Ceridwen2016-01-093-34/+39
| | | | 3 With node.
* Refactor Compare nodes to have two sequences, ops and comparators, ↵Ceridwen2016-01-082-13/+17
| | | | corresponding to the stdlib Compare node.
* Use keys and values as separate arguments for nodes.DictClaudiu Popa2016-01-043-13/+26
| | | | | | | | 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.
* Add .builtins() method to the manager, for retrieving the builtins module. ↵Claudiu Popa2016-01-041-7/+7
| | | | Close #300
* Lambda is no longer at the top of the FunctionDef.Claudiu Popa2016-01-031-51/+59
| | | | | | This means that checks such as ``isinstance(node, Lambda)`` will not hold true anymore for Functions. Closes #291
* Remove the old aliases for ass_type / file_bytes / file and nodes.Claudiu Popa2016-01-033-73/+0
|
* file_stream is no more, using .stream() is the recommended way to obtain a ↵Claudiu Popa2016-01-021-15/+0
| | | | module stream.
* Move mixins into tree.base.Claudiu Popa2016-01-023-25/+239
| | | | | | 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
* Remove do_import_module and real_name from ImportFrom and Import nodes.Claudiu Popa2016-01-021-2/+8
| | | | | | | | | | | | | | 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
* Move qname() definition into a separate mixinClaudiu Popa2015-12-301-3/+13
| | | | | | | | 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.
* Move lookup specific bits into interpreter.lookupClaudiu Popa2015-12-291-280/+11
| | | | | | | | | | | 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.
* We're raising TypeError in 2.0 for old-style class operations, not ↵Claudiu Popa2015-12-291-1/+1
| | | | NotImplementedError.