summaryrefslogtreecommitdiff
path: root/astroid/protocols.py
Commit message (Collapse)AuthorAgeFilesLines
* Remove the # coding, since PEP3120 the default is UTF8Pierre Sassoulas2021-02-171-1/+0
|
* Update copyright noticehippo912021-02-151-0/+1
|
* New copyright noticeshippo912020-12-271-0/+2
|
* Fix starred_assigned_stmts elts cast (introduced in d68f2935)Vilnis Termanis2020-12-241-2/+1
| | | | Don't replace elts (deque) used in loop with list
* Fix exception causes all over the codebase (#806)Ram Rachum2020-06-201-2/+2
|
* Add missing copyright annotations for the past releasesClaudiu Popa2020-04-271-2/+4
|
* Do not infer the first argument of a staticmethod in a metaclass as the ↵Claudiu Popa2020-03-071-2/+7
| | | | | | class itself Close PyCQA/pylint#3032
* Prevent a recursion error when inferring self-referential variables without ↵Claudiu Popa2020-03-051-1/+1
| | | | | | definition Close PyCQA/pylint#1285
* ``nodes.Const.itered`` returns a list of ``Const`` nodes, not stringsClaudiu Popa2019-12-151-1/+3
| | | | | | | Because ``Const.itered`` was not returning proper nodes, pylint was failing when trying to infer objects created from those nodes. Close PyCQA/pylint#3306
* Add support for inferring propertiesClaudiu Popa2019-12-041-1/+1
| | | | | These new capabilities will allow inferring both the `property` builtin as well as property attributes such as `.deleter` and `.setter`.
* Scope the inference to the current bound node when inferring instances of ↵Claudiu Popa2019-11-251-0/+2
| | | | | | | | | | | | | classes When inferring instances of classes from arguments, such as ``self`` in a bound method, we could use as a hint the context's ``boundnode``, which indicates the instance from which the inference originated. As an example, a subclass that uses a parent's method which returns ``self``, will override the ``self`` to point to it instead of pointing to the parent class. Close PyCQA/pylint#3157
* Add support for inferring exception instances in all contextsClaudiu Popa2019-11-171-2/+2
| | | | | | | | | | | We were able to infer exception instances as ``ExceptionInstance`` only for a handful of cases, but not all. ``ExceptionInstance`` has support for better inference of `.args` and other exception related attributes that normal instances do not have. This additional support should remove certain false positives related to ``.args`` and other exception attributes in ``pylint``. Close PyCQA/pylint#2333
* Infer args unpacking of ``self``Claudiu Popa2019-11-141-0/+3
| | | | | | | | | | Certain stdlib modules use ``*args`` to encapsulate the ``self`` parameter, which results in uninferable instances given we rely on the presence of the ``self`` argument to figure out the instance where we should be setting attributes. Close PyCQA/pylint#3216
* Allow inferring positional only arguments on Python 3.8Claudiu Popa2019-11-141-2/+2
|
* Fix linting errorsClaudiu Popa2019-09-111-1/+0
|
* Remove redundant compatibility code (#693)Hugo van Kemenade2019-09-101-4/+1
|
* Add inference support to NamedExpr nodesClaudiu Popa2019-06-021-0/+17
|
* Drop a superfluous and wrong callcontext when inferring the result of a ↵Claudiu Popa2019-04-091-2/+0
| | | | | | | | | | | | | context manager The callcontext was containing the instance of the class (self) as the sole argument, but this was tripping the inference of unknown arguments coming down into an instance, such as the one from the commit's example. By dropping the superfluous callcontext, the inference can no longer assume that the first argument is the instance of the class, leading to wrongly infer `self.client` as the first argument of the instantiation call. Close PyCQA/pylint#2859
* Replace a couple of returns with explicit InferenceError exceptionsClaudiu Popa2019-01-191-8/+10
|
* Remove StopIteration handling which should not leak at all from inferenceClaudiu Popa2019-01-181-10/+3
|
* Reuse the cls variable inferred earlierClaudiu Popa2018-10-111-1/+1
|
* Update some leftover docstringsClaudiu Popa2018-10-111-5/+9
|
* Use yield fromClaudiu Popa2018-10-101-2/+1
|
* Remove some unneeded comments and use yield fromClaudiu Popa2018-10-101-6/+2
|
* Use itertools.chain to join multiple generators togetherClaudiu Popa2018-10-101-3/+8
|
* Use a generator expression for _multiply_seq_by_intClaudiu Popa2018-10-101-8/+6
|
* Initial formatting of astroidClaudiu Popa2018-10-021-118/+158
|
* Rename asspath to assign_path to be more indicative of what it actually meansClaudiu Popa2018-10-021-44/+45
|
* infer_call_result can raise InferenceError so make sure to handle that for ↵Claudiu Popa2018-07-311-2/+1
| | | | | | | | | | | the call sites where it is used infer_call_result started recently to raise InferenceError for objects for which it could not find any returns. Previously it was silently raising a StopIteration, which was especially leaking when calling builtin methods. Since it is after all an inference method, it is expected that it could raise an InferenceError rather than returning nothing. Close PyCQA/pylint#2350
* Cut obsolete "explicit StopIteration" commentsNick Drozd2018-07-301-8/+0
| | | | The explicit StopIterations were themselves were cut in ceeee097.
* Spelling fixesVille Skyttä2018-07-241-5/+5
|
* Update the copyright noticesastroid-2.0Claudiu Popa2018-07-151-2/+12
|
* Fix inference for nested callsBryce Guinta2018-07-051-1/+2
| | | | | | | | | Add context_lookup to the context class as extra_context. Deliver the correct context with the correct boundnode for function argument nodes. Close #177
* Disable too-many-* for this functionClaudiu Popa2018-06-151-1/+1
|
* Drop the requirement that lhs and rhs should have the same number of ↵Claudiu Popa2018-06-151-9/+10
| | | | | | elements when inferring Starred This improves the capabilities a bit, since we know infer those as empty lists
* Added inference support for starred nodes in for loopsClaudiu Popa2018-06-151-5/+100
| | | | Close #146
* Use postinit() to initialize the list generated by a Starred nodeClaudiu Popa2018-06-151-3/+9
|
* The exception should be IndexError, not KeyError, since items is a listClaudiu Popa2018-06-151-1/+1
|
* Support unpacking for dicts in assignmentsClaudiu Popa2018-06-141-13/+25
| | | | Close #268
* Remove useless TODOs that are either issues in the issue tracker or things ↵Claudiu Popa2018-06-121-3/+1
| | | | which we'll never get to fix/change
* Convert to yield fromNick Drozd2018-06-081-17/+8
| | | | | | | I tried this to see if it would improve performance. It didn't, but it does look nicer, so we might as well keep it. See also 5fd5aa81483e709cb5c464c7d4bb37c8c39f2afa
* Remove reraise() in favour of using raise..fromClaudiu Popa2018-05-311-9/+9
|
* Fix lint errorsAshley Whetter2018-05-051-2/+2
|
* Fix StopIteration raising for python3.7 (#534)HoverHell2018-04-241-15/+24
| | | | | | Because we don't support Python 2 any longer in the master branch, we can return values from generators to signal that we want to throw a StopIteration, without actually raising the StopIteration itself.
* Fix contextmanager transform for nested contextmanagersBryce Guinta2018-03-051-1/+4
| | | | Close PyCQA/pylint#1746
* Remove Python 2 branches, assume we always run on Python 3Claudiu Popa2018-02-211-4/+2
|
* Filter non-inferables nodes when inferring binary operationsClaudiu Popa2017-12-151-1/+2
| | | | Close #467
* Public facing node documentationAshley Whetter2017-11-051-0/+1
|
* Fix an inference for trying to unpack Uninferable value in context manager ↵Łukasz Rogalski2017-05-221-0/+5
| | | | | | (#429) Closes PyCQA/pylint#1463
* Fix assigned_stmts() for AnnAssign nodes without value (#420)Łukasz Rogalski2017-04-021-1/+9
| | | | Fixes #419 and PyCQA/pylint#1389