summaryrefslogtreecommitdiff
path: root/ChangeLog
Commit message (Collapse)AuthorAgeFilesLines
* Changed the way how parameters are being builtClaudiu Popa2016-02-131-0/+19
| | | | | | | | | | | | | | | 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
* NodeNG.nearest was removed.Claudiu Popa2016-01-251-0/+3
|
* Fix unpack_infer to fail if results are emptyDave Baum2016-01-151-0/+3
| | | | | This should prevent a StopIteration leaking when next is called over unpack_infer.
* Support accessing properties using super().Claudiu Popa2016-01-151-0/+2
|
* Enforce strong updates per frames.Claudiu Popa2016-01-121-0/+13
| | | | | | | | | | | | 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.
* Use keys and values as separate arguments for nodes.DictClaudiu Popa2016-01-041-1/+4
| | | | | | | | 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.
* Lambda is no longer at the top of the FunctionDef.Claudiu Popa2016-01-031-0/+6
| | | | | | This means that checks such as ``isinstance(node, Lambda)`` will not hold true anymore for Functions. Closes #291
* Move mixins into tree.base.Claudiu Popa2016-01-021-0/+2
| | | | | | 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-0/+11
| | | | | | | | | | | | | | 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
* Add support for inference on threading.LockLaura Médioni2015-12-291-0/+8
|
* The slots() method conflates all the slots from the ancestors into a list of ↵Claudiu Popa2015-12-291-0/+7
| | | | | | | | 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.
* Don't forget to give credit to the original author.Claudiu Popa2015-12-291-1/+1
|
* Use printf-style formatting in as_string, in order to avoid a potential ↵Claudiu Popa2015-12-291-1/+13
| | | | problem with encodings when using .format.
* Some nodes got a new attribute, 'ctx', which tells in which context the said ↵Claudiu Popa2015-12-081-0/+8
| | | | | | | | | | | | | | | | | | | 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.
* relative_to_absolute_name will now raise TooManyLevelsError when a relative ↵Claudiu Popa2015-12-061-0/+3
| | | | import is trying to access something beyond the top-level package.
* AstroidBuildingException is now AstroidBuildingError, the former being ↵Claudiu Popa2015-12-061-0/+3
| | | | removed in 2.0.
* Add two new exceptions, AstroidImportError and AstroidSyntaxError.Claudiu Popa2015-12-061-0/+11
| | | | | | | | 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.
* assigned_stmts methods have the same signature from now on.Claudiu Popa2015-12-051-0/+7
| | | | | | | 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.
* Fix a bug in the inference of Starred nodesClaudiu Popa2015-11-111-0/+4
| | | | | | This bug occurs when the left hand side of an assignment has an extra element comparing with the right hand side, which makes the Starred node to not be inferred correctly as an empty List. Closes issue #239.
* .scope() returns the proper scope for Arguments's default values, function ↵Claudiu Popa2015-11-101-0/+3
| | | | annotations and comprehensions. Closes issue #211.
* Class.getattr('__mro__') returns the actual MRO.Claudiu Popa2015-10-261-0/+3
| | | | | | | | 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.
* Add support for indexing containers with instances which provides an ↵Claudiu Popa2015-10-221-0/+3
| | | | | | | | __index__ returning-int method. This patch moves _class_as_index to helpers, where it becames class_instance_as_index. Also, it instantiates its own call context, which makes certain idioms with lambdas to work.
* Add a new node, DictUnpack, for representing the unpacking of a dict using ↵Claudiu Popa2015-10-061-0/+9
| | | | | | | | | PEP 448 This is a different approach than what the builtin ast module does, since it just uses None to represent this kind of operation, which seems conceptually wrong, due to the fact the AST contains non-AST nodes. Closes issue #206.
* Add brain tip for understanding numpy.core's mutation of the __all__ variableClaudiu Popa2015-09-241-0/+2
| | | | | | | | Since astroid doesn't understand properly augmented assignments, we have false positives with pylint when trying to find numpy attributes defined in some submodules, since numpy and numpy.core generates the __all__ list by appending values from the subimport's __all__. This should fix pylint's issue #453.
* Understand the `slice` builtin. Closes issue #184.Claudiu Popa2015-09-111-0/+2
|
* Add support for understanding class creation using `type.__new__(mcs, name, ↵Claudiu Popa2015-09-021-0/+7
| | | | | | | | bases, attrs)`` Until now, inferring this kind of calls resulted in Instances, not in classes, since astroid didn't understand that the presence of the metaclass in the call leads to a class creationg, not to an instance creation.
* Add ChangeLog entries for the newest changes.Claudiu Popa2015-08-251-0/+20
|
* Understand slices of tuples, lists, strings and instances with support for ↵Claudiu Popa2015-08-211-0/+5
| | | | | | slices. Closes issue #137.
* Class._explicit_metaclass is now a public API, in the form of ↵Claudiu Popa2015-08-041-1/+7
| | | | | | | | Class.declared_metaclass. Class.mro remains the de facto method for retrieving the metaclass of a class, which will also do an evaluation of what declared_metaclass returns.
* There's a new separate step for transforms.Claudiu Popa2015-08-021-0/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | Until now, the transforms were applied at the same time the tree was being built. This was problematic if the transform functions were using inference, since the inference was executed on a partially constructed tree, which led to failures when post-building information was needed (such as setting the _from_names for the From imports). Now there's a separate step for transforms, which are applied using transform.TransformVisitor. There's a couple of other related changes: * astroid.parse and AstroidBuilder gained a new parameter `apply_transforms`, which is a boolean flag, which will control if the transforms are applied. We do this because there are uses when the vanilla tree is wanted, without any implicit modification. * the transforms are also applied for builtin modules, as a side effect of the fact that transform visiting was moved in AstroidBuilder._post_build from AstroidBuilder._data_build. Closes issue #116.
* Class.getattr looks by default in the implicit and the explicit metaclasses, ↵Claudiu Popa2015-07-261-0/+5
| | | | | | which is `type` on Python 3. Closes issue #114.
* Add get_wrapping_class API to scoped_nodes, which can be used to retrieve ↵Claudiu Popa2015-07-261-0/+3
| | | | the class that wraps a node.
* Add changelog entry.Florian Bruhin2015-07-251-0/+3
| | | | | --HG-- branch : no-logilab-common
* do_import_module passes the proper relative_only flag if the level is higher ↵Claudiu Popa2015-07-141-0/+6
| | | | | | | | | than 1. This has the side effect that using `from .something import something` in a non-package will finally result in an import-error on Pylint's side. Until now relative_only was ignored, leading to the import of `something`, if it was globally available.
* Add a new convenience API, `astroid.parse`.Claudiu Popa2015-07-111-0/+6
| | | | | | This API can be used to retrieve an astroid AST from a source code string, similar to how ast.parse can be used to obtain a Python AST from a source string. This is the test_utils.build_module promoted to a public API.
* Understand metaclasses added with six.add_metaclass decorator. Closes issue ↵Claudiu Popa2015-07-071-0/+2
| | | | #129.
* Move pyreverse specific modules and functionality back into pyreverseClaudiu Popa2015-07-031-0/+3
| | | | | We moved astroid.manager.Project and astroid.manager.Manager.project_from_files to pyreverse.inspector.
* Add ChangeLog entry for the last commit.Claudiu Popa2015-07-021-0/+2
|
* Add support for inferring subscript on instances, which will use ↵Claudiu Popa2015-07-011-0/+3
| | | | __getitem__. Closes issue #124.
* Add support for indexing bytes on Python 3.Claudiu Popa2015-07-011-0/+2
|
* Add annotation support for function.as_string(). Closes issue #37.Claudiu Popa2015-07-011-0/+2
|
* Star unpacking in assignments returns properly a list, not the individual ↵Claudiu Popa2015-07-011-0/+3
| | | | components. Closes issue #138.
* Add support for multiplication of tuples and lists with instances which ↵Claudiu Popa2015-06-301-0/+3
| | | | provides an __index__ returning-int method.
* Transform lambdas with a self argument at the class level to bound methods.Claudiu Popa2015-06-301-0/+3
|
* Add support for retrieving TypeErrors for binary arithmetic operations and ↵Claudiu Popa2015-06-281-0/+7
| | | | | | | | | augmented assignments. The change is similar to what was added for UnaryOps: a new method called *type_errors* for both AugAssign and BinOp, which can be used to retrieve type errors occurred during inference. Also, a new exception object was added, BinaryOperationError.
* Improve the inference of binary arithmetic operations (normal and augmented)Claudiu Popa2015-06-271-0/+3
| | | | | | This patch completely changes the way how binary and augmented operations are inferred, trying to be as compatible as possible with the semantics from the language reference.
* Add helpers.is_supertype and helpers.is_subtype, two functions for checking ↵Claudiu Popa2015-06-261-0/+3
| | | | if an object is a super/sub type of another.
* Understand the one-argument form of the builtin *type*.Claudiu Popa2015-06-241-0/+5
| | | | | This uses the recently added *astroid.helpers.object_type* in order to retrieve the Python type of the first argument of the call.
* Add astroid.helpers, a module of various useful utilities which don't belong ↵Claudiu Popa2015-06-241-0/+5
| | | | | | | yet into other components. Added *object_type*, a function which can be used to obtain the type of almost any astroid object, similar to how the builtin *type* works.
* NotImplemented is detected properly now as being part of the builtins module.Claudiu Popa2015-06-231-0/+4
| | | | Previously trying to infer the Name(NotImplemented) returned an YES object.