From 243c730c82e3c374ae940e0a2ca0fd1de0f38b1f Mon Sep 17 00:00:00 2001 From: Mikhail Golubev Date: Thu, 17 Mar 2016 16:06:42 +0300 Subject: [PATCH] PY-18788 Don't generate type annotations for "self" parameters --- .../python/codeInsight/intentions/PyAnnotateTypesIntention.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/src/com/jetbrains/python/codeInsight/intentions/PyAnnotateTypesIntention.java b/python/src/com/jetbrains/python/codeInsight/intentions/PyAnnotateTypesIntention.java index 3f91a6a692aa..0d0605d527cd 100644 --- a/python/src/com/jetbrains/python/codeInsight/intentions/PyAnnotateTypesIntention.java +++ b/python/src/com/jetbrains/python/codeInsight/intentions/PyAnnotateTypesIntention.java @@ -203,7 +203,7 @@ public class PyAnnotateTypesIntention implements IntentionAction { PyParameter[] params = function.getParameterList().getParameters(); for (int i = params.length - 1; i >= 0; i--) { - if (params[i] instanceof PyNamedParameter) { + if (params[i] instanceof PyNamedParameter && !params[i].isSelf()) { params[i] = annotateParameter(project, editor, (PyNamedParameter)params[i], false); } }