From d4c45c7db2d978d3518f77f1d042c2a17213ef95 Mon Sep 17 00:00:00 2001 From: Dmitry Jemerov Date: Mon, 1 Feb 2010 19:58:26 +0300 Subject: [PATCH] correctly track argument count for inherited __init__ calls (PY-312) --- .../python/psi/impl/PyCallExpressionHelper.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/python/src/com/jetbrains/python/psi/impl/PyCallExpressionHelper.java b/python/src/com/jetbrains/python/psi/impl/PyCallExpressionHelper.java index d140d9e10761..67c631aa089a 100644 --- a/python/src/com/jetbrains/python/psi/impl/PyCallExpressionHelper.java +++ b/python/src/com/jetbrains/python/psi/impl/PyCallExpressionHelper.java @@ -114,7 +114,14 @@ public class PyCallExpressionHelper { } // decorators? PyFunction method = (PyFunction)resolved; // constructor call? - if (PyNames.INIT.equals(method.getName())) implicit_offset += 1; + if (PyNames.INIT.equals(method.getName())) { + String refName = us.getCallee() instanceof PyReferenceExpression + ? ((PyReferenceExpression) us.getCallee()).getReferencedName() + : null; + if (!PyNames.INIT.equals(refName)) { // PY-312 + implicit_offset += 1; + } + } // look for closest decorator PyDecoratorList decolist = method.getDecoratorList(); if (decolist != null) {