summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Use safe_infer for inference of elements in list multiplication operationfix-list-multiplicationDmitry Pribysh2015-10-241-3/+4
| | | | | Now inference yields YES instead of list item value when multiple values are inferred for one list item.
* Fix inference of list multiplication operation.Dmitry Pribysh2015-10-242-3/+19
| | | | | | | | | Old implementation was pushing all the possible values inferred from a node into a list, thus creating extra items in case when there are multiple infered values yielded. New implementation takes only first infered value, preserving the expected size of the list. Fixes pylint's #559.
* Merged in dmand/astroid/binop-inference-fix (pull request #92)Claudiu Popa2015-10-232-7/+19
|\ | | | | | | Fix binary operator inference issue from pylint's #646
| * Fix binary operation inference crash by using cloned contextsbinop-inference-fixDmitry Pribysh2015-10-211-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | Idea is that we shouldn't use the same context to infer left-hand side and right-hand side of the binary operation because inferring lhs may leave some metadata in context.path that is irrelevant (and can even break inference) to inference of rhs. So we make two clones of the original context and use them to infer left-hand side and right-hand side independently. And then we use the original context to infer the result of the operation applied to inferred values. This patch fixes pylint's issue #646 and may be also related to other similar astroid issues (#198, #199).
| * Add unit test that crashes inference with 'maximum call depth exceeded' error.Dmitry Pribysh2015-10-211-0/+12
| |
* | Remove trailing whitespace.Claudiu Popa2015-10-221-1/+1
| |
* | Add support for indexing containers with instances which provides an ↵Claudiu Popa2015-10-225-20/+56
| | | | | | | | | | | | | | | | __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.
* | Make class_as_index private.Claudiu Popa2015-10-221-2/+2
| |
* | Create a call context when inferring unary operands on instances.Claudiu Popa2015-10-222-15/+19
| |
* | Create a callcontext when determining an instance's truth value.Claudiu Popa2015-10-222-1/+13
| |
* | Create a context call when __enter__ is called for solving what a context ↵Claudiu Popa2015-10-222-0/+31
| | | | | | | | manager returns.
* | Replace the use of print in python3/data/module.py, since it complicates the ↵Claudiu Popa2015-10-221-5/+3
|/ | | | testing of as_string.
* Merged in jayvdb/astroid/use_print_function (pull request #91)Claudiu Popa2015-10-191-1/+1
|\ | | | | | | Fix SyntaxError on Python 2 for print function
| * Merged in jayvdb/astroid/print_statement (pull request #90)Claudiu Popa2015-10-190-0/+0
| |\ | | | | | | | | | Replace __future__.print_statement with print_function
| * | Replace __future__.print_statement with print_functionprint_statementJohn Vandenberg2015-10-191-1/+1
| |/ | | | | | | | | | | 1c35a97 fixed Python 2 only print statements, and imported a mix of __future__.print_function and __future__.print_statement. 1826d98 fixed most of them, however this one still remains.
* | Fix SyntaxError on Python 2 for print functionuse_print_functionJohn Vandenberg2015-10-191-0/+1
|/
* Don't reinstall astroid, use the one that's already available.Claudiu Popa2015-10-161-2/+0
|
* Fix Arguments' _other_fieldsCeridwen2015-10-121-1/+1
|
* Move proxy_alias function to util.pyClaudiu Popa2015-10-113-28/+32
|
* Remove doctype and future imports which aren't useful.Claudiu Popa2015-10-1110-15/+1
|
* Remove unused variable.Claudiu Popa2015-10-111-1/+0
|
* Move decorators from bases to decorators module.Claudiu Popa2015-10-115-76/+81
|
* Move bases.NodeNG and bases.Statement in node_classesClaudiu Popa2015-10-114-538/+537
| | | | | | We're doing this in order to reduce the dependency hell which occurs when a module such as bases.py wants to use classes defined in node_classes.
* Remove trailing whitespace.Claudiu Popa2015-10-091-1/+1
|
* The functional form of Enum returns a class, not an instance.Claudiu Popa2015-10-092-1/+13
|
* Support PEP 448 unpackings in dict calls.Claudiu Popa2015-10-082-11/+47
|
* Make duplicated_kwargs a public API.Claudiu Popa2015-10-082-4/+8
|
* Fix pylint warnings.Claudiu Popa2015-10-071-12/+11
|
* Change arguments.ArgumentsInference to arguments.CallSiteClaudiu Popa2015-10-073-33/+155
| | | | | | This new class can be used to obtain the already unpacked arguments and keyword arguments that a call site uses, which is especially useful when some of arguments are packed into Starred nodes.
* Change the signature of the ArgumentInference class to accept directly the ↵Claudiu Popa2015-10-072-10/+13
| | | | arguments and the keywords of a call site.
* Add brain tips for PyQt signals for supporting emit / connect and disconnect ↵Claudiu Popa2015-10-063-22/+57
| | | | methods on them
* Remove trailing whitespace.Claudiu Popa2015-10-061-1/+0
|
* Add support for looking up into DictUnpack's value in Dict.getitemClaudiu Popa2015-10-062-0/+15
|
* Remove the value from the DictUnpack node, since it's used mostly to ↵Claudiu Popa2015-10-062-10/+1
| | | | represent the ** operation.
* Fix pylint errors.Claudiu Popa2015-10-062-8/+8
|
* Add a new node, DictUnpack, for representing the unpacking of a dict using ↵Claudiu Popa2015-10-066-9/+71
| | | | | | | | | 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.
* Remove trailing whitespace.Claudiu Popa2015-10-031-1/+1
|
* Move objects.Slice back into nodes.SliceClaudiu Popa2015-10-034-49/+37
| | | | | | We did this because objects.Slice had more capabilities than nodes.Slice, such as inferring the slice attributes (start, stop, step) and it was used mostly for inferring the slice() builtin.
* Don't wrap instance's arguments into a Const, instead let the original index ↵Claudiu Popa2015-10-032-19/+28
| | | | | | | | object to be used. This prevents a crash when the original index object is a slice object, which was wrapped inadvertendly in a Const node, leading to a crash later on if the said object was inferred. Closes issue #200.
* Add a test for issue #188, which was triggered because the transforms ↵Claudiu Popa2015-10-031-0/+25
| | | | weren't executed in a separated step. Closes issue #188.
* Fix a crash which occurred when inferring unary operands which yielded ↵Claudiu Popa2015-10-032-0/+10
| | | | objects which weren't callable.
* Skip objects which aren't callable when inferring an instance's call result.Claudiu Popa2015-10-032-1/+17
|
* Make context an optional argument for BoundMethod.infer_call_result.Claudiu Popa2015-10-031-1/+3
|
* Ignore non-callables when looking for special method implementations of bool ↵Claudiu Popa2015-10-032-1/+22
| | | | | | | | methods This commit verifies what a special method actually is and if it's not a callable, then we return an YES object, since there's a big chance to not make sense of the instance's boolean value.
* Import test from pylint regarding a crash that used to occur a long time ago.Claudiu Popa2015-09-301-0/+10
|
* Import test for pylint regarding context inference in relation with factory ↵Claudiu Popa2015-09-291-0/+19
| | | | methods.
* Fix a crash which occurred when extra_decorators was considering non-class ↵Claudiu Popa2015-09-292-1/+27
| | | | level assignments to the same name as decorator calls.
* Remove InferenceContext's __repr__ implementation, since it makes it ↵Claudiu Popa2015-09-281-6/+0
| | | | unusable to debug in a repl.
* Add test for issue #183.Claudiu Popa2015-09-271-0/+9
|
* Hopefully actually fix #185Ceridwen2015-09-262-2/+13
|