summaryrefslogtreecommitdiff
path: root/astroid/context.py
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'sum_and_multiply' of https://github.com/hippo91/astroidsum_and_multiplyhippo912021-01-231-4/+6
|\
| * Merge branch 'master' into sum_and_multiplyhippo912020-06-201-1/+1
| |\
| * | Turns the context.path from a set to a dict which values are the number of ↵hippo912019-12-301-4/+6
| | | | | | | | | | | | times the node has been visited. The push method return True depending on a condition of the number of visits.
* | | New copyright noticeshippo912020-12-271-1/+2
| | |
* | | Squash one-off inference utility functions to help reduce recursion errors ↵Bryce Guinta2020-06-221-11/+0
| |/ |/| | | | | | | | | (#804) This also makes debugging a lot simpler reducing the complexity of the function stack.
* | Add missing copyright annotations for the past releasesClaudiu Popa2020-04-271-1/+1
|/
* Revert "Remove the restore_path() method"Claudiu Popa2019-01-171-1/+7
| | | | | | This reverts commit 8151853e9525252b75ae560273a709cbed47ddc5 which was added while investigating the slowdown caused by context's path copying. Turns out this change doesn't have a negative impact on the performance but it has a positive one on the inference.
* Revert path copying in InferenceContext()Claudiu Popa2018-12-301-1/+1
| | | | | | | | While copying the path solves some inference issues, it also leads to horrenduous performance hits on large libraries such as pandas. We still want to have the path copying, but we need a better understanding on why that is needed, as well as a change on how we operate with the inference contexts.
* Replace copy.copy() with a simple set() callClaudiu Popa2018-10-101-9/+1
|
* Use copy_context where it makes senseClaudiu Popa2018-10-101-5/+4
|
* Initial formatting of astroidClaudiu Popa2018-10-021-6/+15
|
* Update the copyright noticesastroid-2.0Claudiu Popa2018-07-151-2/+4
|
* Remove the copying of extra_context, since the object is already not ↵Claudiu Popa2018-07-081-1/+1
| | | | mutated. Discovered during #588
* Fix inference for nested callsBryce Guinta2018-07-051-1/+9
| | | | | | | | | Add context_lookup to the context class as extra_context. Deliver the correct context with the correct boundnode for function argument nodes. Close #177
* Refactor assinging boundnode to contextBryce Guinta2018-07-041-0/+25
| | | | | Code in multiple places had the same pattern for infering call results.
* Fix useless-object-inheritance lint error (#573)Nick Drozd2018-06-281-2/+2
| | | See https://github.com/PyCQA/pylint/pull/2209
* Fix lintingClaudiu Popa2018-06-141-1/+0
|
* Update InferenceContext attribute documentationBryce Guinta2018-03-291-3/+33
|
* Fix inference issue with inference path cloningBryce Guinta2018-01-281-1/+32
| | | | Copy inference path in inference context upon cloning to prevent diverging inference paths causing uninferable results
* Remove occurrences of no-else-return and consider-using-ternaryClaudiu Popa2016-12-181-2/+2
|
* Even more granular copyrights (thanks to copyrite)Claudiu Popa2016-07-221-2/+3
|
* Keep a consistent copyright notice across the board.Claudiu Popa2016-07-191-0/+2
|
* Convert all files to new license headerCeridwen2016-05-161-17/+3
|
* Remove doctype and future imports which aren't useful.Claudiu Popa2015-10-111-1/+1
|
* Remove InferenceContext's __repr__ implementation, since it makes it ↵Claudiu Popa2015-09-281-6/+0
| | | | unusable to debug in a repl.
* Make pylint happyy.Claudiu Popa2015-09-251-1/+1
|
* Change a couple of readability issues, proper variable names and so on.Claudiu Popa2015-09-181-6/+8
|
* Final draft of state printing after mergeCeridwen2015-09-131-67/+7
|\ | | | | | | | | | | | | | | | | | | | | | | | | This patch adds __str__` and `__repr__` methods to InferenceContext and alters the `__str__, `__repr__, and repr_tree() methods for NodeNG. The `__str__` methods print out formatted information about the object's fields; NodeNG's `__str__` method is not recursive. InferenceContext's __repr__` gives a compact representation of its fields. I slightly shortened NodeNG's `__repr__` method by removing a field that's usually empty. I rewrote repr_tree() to better format the information it contains and to display *all* the fields for each AST node, with some fields controlled by options to avoid spam. I also fixed https://bitbucket.org/logilab/astroid/issues/185/as_string-gives-wrong-result-for-keyword .
| * Improve the understanding of argumentsClaudiu Popa2015-09-091-67/+7
| | | | | | | | | | | | | | | | This changeset introduces a better way to understand arguments passed into call sites. The original logic was moved from astroid.context.CallContext, which become only a container for arguments and keyword arguments, to astroid.arguments.ArgumentInferator, a new class for understanding arguments.
* | Final draft of improved state printingCeridwen2015-09-131-0/+11
|/
* Don't raise StopIteration in InferenceContext.push, instead exit from the ↵Claudiu Popa2015-08-281-2/+3
| | | | | | | generator by doing an early return This makes astroid compliant with PEP 479 changes, since in the future it will be prohibited to exit from a generator by raising a StopIteration.
* Fix most obvious errors intorduced by the latest mergeCeridwen2015-08-141-8/+8
|
* Move InferenceContext and CallContext into astroid.contextClaudiu Popa2015-08-121-0/+141
In order to reduce circular dependencies between components, CallContext is moved into a new module, astroid.context. At the same time, for increasing the cohesion inside astroid.bases, InferenceContext was moved as well into astroid.context.