no-redundant-arguments-super¶
Remove redundant arguments when using super for readability.
Message¶
Do not use arguments when calling super for the parent class.
References¶
Valid examples¶
class Foo(Bar):
def foo(self, bar):
super().foo(bar)
class Foo(Bar):
def foo(self, bar):
super(Bar, self).foo(bar)
Show more
class Foo(Bar):
@classmethod
def foo(cls, bar):
super(Bar, cls).foo(bar)
class Foo:
class InnerBar(Bar):
def foo(self, bar):
pass
class InnerFoo(InnerBar):
def foo(self, bar):
super(InnerBar, self).foo(bar)
Invalid examples¶
class Foo(Bar):
def foo(self, bar):
super(Foo, self).foo(bar)
Suggested fix
class Foo(Bar):
def foo(self, bar):
super().foo(bar)
Show more
class Foo(Bar):
@classmethod
def foo(cls, bar):
super(Foo, cls).foo(bar)
Suggested fix
class Foo(Bar):
@classmethod
def foo(cls, bar):
super().foo(bar)
class Foo:
class InnerFoo(Bar):
def foo(self, bar):
super(Foo.InnerFoo, self).foo(bar)
Suggested fix
class Foo:
class InnerFoo(Bar):
def foo(self, bar):
super().foo(bar)
class Foo:
class InnerFoo(Bar):
class InnerInnerFoo(Bar):
def foo(self, bar):
super(Foo.InnerFoo.InnerInnerFoo, self).foo(bar)
Suggested fix
class Foo:
class InnerFoo(Bar):
class InnerInnerFoo(Bar):
def foo(self, bar):
super().foo(bar)