---
source: crates/ruff_linter/src/rules/pyupgrade/mod.rs
---
UP008.py:17:23: UP008 [*] Use `super()` instead of `super(__class__, self)`
   |
16 |     def wrong(self):
17 |         parent = super(Child, self)  # wrong
   |                       ^^^^^^^^^^^^^ UP008
18 |         super(Child, self).method  # wrong
19 |         super(
   |
   = help: Remove `__super__` parameters

ℹ Unsafe fix
14 14 |         Parent.super(1, 2)  # ok
15 15 | 
16 16 |     def wrong(self):
17    |-        parent = super(Child, self)  # wrong
   17 |+        parent = super()  # wrong
18 18 |         super(Child, self).method  # wrong
19 19 |         super(
20 20 |             Child,

UP008.py:18:14: UP008 [*] Use `super()` instead of `super(__class__, self)`
   |
16 |     def wrong(self):
17 |         parent = super(Child, self)  # wrong
18 |         super(Child, self).method  # wrong
   |              ^^^^^^^^^^^^^ UP008
19 |         super(
20 |             Child,
   |
   = help: Remove `__super__` parameters

ℹ Unsafe fix
15 15 | 
16 16 |     def wrong(self):
17 17 |         parent = super(Child, self)  # wrong
18    |-        super(Child, self).method  # wrong
   18 |+        super().method  # wrong
19 19 |         super(
20 20 |             Child,
21 21 |             self,

UP008.py:19:14: UP008 [*] Use `super()` instead of `super(__class__, self)`
   |
17 |           parent = super(Child, self)  # wrong
18 |           super(Child, self).method  # wrong
19 |           super(
   |  ______________^
20 | |             Child,
21 | |             self,
22 | |         ).method()  # wrong
   | |_________^ UP008
   |
   = help: Remove `__super__` parameters

ℹ Unsafe fix
16 16 |     def wrong(self):
17 17 |         parent = super(Child, self)  # wrong
18 18 |         super(Child, self).method  # wrong
19    |-        super(
20    |-            Child,
21    |-            self,
22    |-        ).method()  # wrong
   19 |+        super().method()  # wrong
23 20 | 
24 21 | 
25 22 | class BaseClass:

UP008.py:36:14: UP008 [*] Use `super()` instead of `super(__class__, self)`
   |
34 | class MyClass(BaseClass):
35 |     def normal(self):
36 |         super(MyClass, self).f()  # can use super()
   |              ^^^^^^^^^^^^^^^ UP008
37 |         super().f()
   |
   = help: Remove `__super__` parameters

ℹ Unsafe fix
33 33 | 
34 34 | class MyClass(BaseClass):
35 35 |     def normal(self):
36    |-        super(MyClass, self).f()  # can use super()
   36 |+        super().f()  # can use super()
37 37 |         super().f()
38 38 | 
39 39 |     def different_argument(self, other):

UP008.py:50:18: UP008 [*] Use `super()` instead of `super(__class__, self)`
   |
49 |         def inner_argument(self):
50 |             super(MyClass, self).f()  # can use super()
   |                  ^^^^^^^^^^^^^^^ UP008
51 |             super().f()
   |
   = help: Remove `__super__` parameters

ℹ Unsafe fix
47 47 |             super(MyClass, self).f()  # CANNOT use super()
48 48 | 
49 49 |         def inner_argument(self):
50    |-            super(MyClass, self).f()  # can use super()
   50 |+            super().f()  # can use super()
51 51 |             super().f()
52 52 | 
53 53 |         outer_argument()


