use correct first parameter name (PY-1811)

This commit is contained in:
Dmitry Jemerov
2010-09-14 21:21:53 +04:00
parent 6c69714ec2
commit e20f472cff
4 changed files with 22 additions and 1 deletions
@@ -177,7 +177,7 @@ public class PyOverrideImplementUtil {
statementBody.append("(");
final LanguageLevel langLevel = ((PyFile)pyClass.getContainingFile()).getLanguageLevel();
if (!langLevel.isPy3K()) {
statementBody.append(pyClass.getName()).append(", self");
statementBody.append(pyClass.getName()).append(", ").append(PyUtil.getFirstParameterName(baseFunction));
}
statementBody.append(").").append(baseFunction.getName()).append("(");
startIndex = 1;
@@ -0,0 +1,7 @@
class A(object):
@classmethod
def m(cls):
pass
class B(A):
<caret>pass
@@ -0,0 +1,10 @@
class A(object):
@classmethod
def m(cls):
pass
class B(A):
@classmethod
def m(cls):
<selection>super(B, cls).m()</selection>
@@ -42,6 +42,10 @@ public class PyOverrideTest extends PyLightFixtureTestCase {
doTest();
}
public void testClassmethodNewStyle() {
doTest();
}
public void testPy3k() {
PythonLanguageLevelPusher.setForcedLanguageLevel(myFixture.getProject(), LanguageLevel.PYTHON31);
try {