summaryrefslogtreecommitdiff
path: root/ChangeLog
Commit message (Collapse)AuthorAgeFilesLines
* 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.Claudiu Popa2015-12-061-0/+3
| | | | The first name will exist until astroid 2.0.
* Add two new exceptions, AstroidImportError and AstroidSyntaxError.Claudiu Popa2015-12-061-0/+8
| | | | | | | | 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/+11
| | | | | | | 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.
* Don't forget to give credit to the original author.Claudiu Popa2015-12-011-1/+1
|
* Use printf-style formatting in as_string, in orderClaudiu Popa2015-12-011-1/+16
| | | | | | | to avoid a potential problem with encodings when using .format. Closes issue #273.
* 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
|
* 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.
* Add support for Python 3.5's MatMul infix operator. See PEP 465 for more ↵Claudiu Popa2015-06-211-0/+3
| | | | details.
* Add `igetattr` method to scoped_nodes.Function.Claudiu Popa2015-06-201-0/+2
|
* Add inference support for the `bool` builtin.Claudiu Popa2015-06-171-0/+2
|
* astroid.utils.ASTWalker and astroid.utils.LocalsVisitor were moved to ↵Claudiu Popa2015-06-171-0/+3
| | | | pylint.pyreverse.utils.
* astroid.inspector was moved to pylint.pyreverse.Claudiu Popa2015-06-171-0/+4
| | | | | | | This was moved since it is the only known client of this module. No other change was made to the exported API. This doesn't go through a normal deprecation cycle, since I really want to clean it up at a faster pace.
* Add inference support for `callable` builtin.Claudiu Popa2015-06-161-0/+2
|
* Add inference support for boolean operations (`and` and `not`).Claudiu Popa2015-06-161-0/+2
|
* Add a new method to the AST nodes, 'bool_value'.Claudiu Popa2015-06-141-0/+9
| | | | | | | | | | It is used to deduce the value of a node when used in a boolean context, which is useful for both inference, as well as for data flow analysis, where we are interested in what branches will be followed when the program will be executed. `bool_value` returns True, False or YES, if the node's boolean value can't be deduced. The method is used when inferring the unary operand `not`. Thus, `not something` will result in calling `something.bool_value` and negating the result, if it is a boolean.
* Make the first steps towards detecting type errors for unary and binary ↵Claudiu Popa2015-06-111-0/+11
| | | | | | | | | | | | operations. In exceptions, one object was added for holding information about a possible UnaryOp TypeError, object called `UnaryOperationError`. Even though the name suggests it's an exception, it's actually not one. When inferring UnaryOps, we use this special object to mark a possible TypeError, object which can be interpreted by pylint in order to emit a new warning. We are also exposing a new method for UnaryOps, called `type_errors`, which returns a list of UnaryOperationsError.
* Improve the inference of six.moves.Claudiu Popa2015-06-101-0/+4
| | | | | | This patch improves especially the inferrence when using `from ... import ...` syntax. Also, we added a new fail import hook for six.moves, which fixes the import-error false positive from pylint. Closes issue #107.
* Improve the inference of UnaryOperands.Claudiu Popa2015-06-101-0/+6
| | | | | | When inferring unary operands, astroid looks up the return value of __pos__, __neg__ and __invert__ to determine the inferred value of ``~node``, ``+node`` or ``-node``.
* Don't leak StopIteration when inferring invalid UnaryOps.Claudiu Popa2015-06-091-0/+2
|
* Add 'assert_equals' method in nose.tools's brain plugin.Claudiu Popa2015-06-091-0/+2
|