summaryrefslogtreecommitdiff
path: root/astroid/node_classes.py
Commit message (Collapse)AuthorAgeFilesLines
* Remove trailing whitespace.Claudiu Popa2015-07-011-1/+1
|
* Use six constants for python versions.Claudiu Popa2015-07-011-7/+3
|
* Add support for indexing bytes on Python 3.Claudiu Popa2015-07-011-0/+5
|
* Add annotation support for function.as_string(). Closes issue #37.Claudiu Popa2015-07-011-4/+6
|
* Merged in jarradhope/astroid (pull request #73)Claudiu Popa2015-07-011-4/+12
|\ | | | | | | add annotations to as_string method of Arguments
| * annotations = Nonejarradhope2015-04-261-1/+3
| |
| * add annotations to as_string method of Argumentsjarradhope2015-04-261-4/+10
| |
* | Add support for retrieving TypeErrors for binary arithmetic operations and ↵Claudiu Popa2015-06-281-1/+40
| | | | | | | | | | | | | | | | | | 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.
* | Remove trailing whitespace.Claudiu Popa2015-06-241-1/+1
| |
* | NotImplemented is detected properly now as being part of the builtins module.Claudiu Popa2015-06-231-1/+2
| | | | | | | | Previously trying to infer the Name(NotImplemented) returned an YES object.
* | Add inference support for boolean operations (`and` and `not`).Claudiu Popa2015-06-161-1/+1
| |
* | Implement bool_value correctly for data structures.Claudiu Popa2015-06-161-0/+15
| |
* | Add a new method to the AST nodes, 'bool_value'.Claudiu Popa2015-06-141-4/+3
| | | | | | | | | | | | | | | | | | | | 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-1/+18
| | | | | | | | | | | | | | | | | | | | | | | | 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.
* | Fix pylint warnings over astroid, update the list of disabled messages in ↵Claudiu Popa2015-05-191-2/+4
| | | | | | | | pylintrc.
* | Remove redundant if, astroid is 2.7+ only.Claudiu Popa2015-05-191-2/+1
|/
* Protect against a TypeError in Arguments.fromlineno.Claudiu Popa2015-03-121-1/+1
| | | | | | The parent's fromlineno can be None when the parent is a function retrieved from the builtins module, which will not have the source code at hand.
* Change the way how context caching and scoping is done.Claudiu Popa2015-03-111-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch reverts some changes added by a couple of changesets, making the context caching and scoping to work as before. The changesets in question are: * 41b3bd589da0549ac061bc4c4b5d379cdbb1e10c Replace copy_context with some dynamic scoping. * 8d3c601 Remove context.lookupname; make it an argument to infer() when appropriate. * partially reverts 048a42c. Fix some deep recursion problems. There were some problems with these changes, which led to horrendous performance when dealing with multiple inference paths of the same names, as seen in these Pylint issues: * https://bitbucket.org/logilab/pylint/issue/395/horrible-performance-related-to-inspect * https://bitbucket.org/logilab/pylint/issue/465/pylint-hangs-when-using-inspectsignature * https://bitbucket.org/logilab/pylint/issue/430/pylint-140-execution-time-and-memory The reverted changes assumed that a context it's only passed to callees and then destroyed, thus InferenceContext.push always returned another inference context, with the updated inference path so far. This is wrong, since contexts are sometimes reused, so the original context, the one before the .push call need to have the same cache key in its path (this is actually what's happening in these mentioned issues, the same object is inferred over and over again, but with different contexts).
* Fix all unused imports in the code base.Claudiu Popa2015-01-291-1/+1
| | | | Also, this patch adds a new rule in the pylintrc for the CI gate.
* Remove all trailing whitespaces.Claudiu Popa2015-01-101-1/+1
|
* Add inference tips for 'tuple', 'set' and 'list' builtins.Claudiu Popa2014-11-281-1/+1
| | | | | | | | This patch adds some inference tips for the mentioned builtins, making calls such as 'list([4, 5, 6])` be inferred the same as `[4, 5, 6]`. Previosly, inferring those objects resulted in an Instance of the given builtin, without having access to their elements. This is useful, for instance, when trying to infer slots defined with set, list of tuple calls (instead of their syntactic equivalents).
* Move all astroid modules into a its own directory, which is now the package.Torsten Marek2014-11-081-0/+965
python setup.py develop now works.