From 130406463f3c978571a7aca6e33c985e17848f21 Mon Sep 17 00:00:00 2001 From: Claudiu Popa Date: Mon, 25 Nov 2019 08:32:49 +0100 Subject: Scope the inference to the current bound node when inferring instances of 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 --- ChangeLog | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'ChangeLog') diff --git a/ChangeLog b/ChangeLog index 86abec8b..99457ef8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -12,6 +12,17 @@ Release Date: TBA * Allow inferring positional only arguments. +* Scope the inference to the current bound node when inferring instances of 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 contexts We were able to infer exception instances as ``ExceptionInstance`` -- cgit v1.2.1