[UP008]: use super(), not __super__ in error messages (#18743)
Some checks failed
CI / Determine changes (push) Waiting to run
CI / cargo fmt (push) Waiting to run
CI / cargo clippy (push) Blocked by required conditions
CI / cargo test (linux) (push) Blocked by required conditions
CI / cargo test (linux, release) (push) Blocked by required conditions
CI / cargo test (windows) (push) Blocked by required conditions
CI / cargo test (wasm) (push) Blocked by required conditions
CI / cargo build (release) (push) Waiting to run
CI / cargo build (msrv) (push) Blocked by required conditions
CI / cargo fuzz build (push) Blocked by required conditions
CI / fuzz parser (push) Blocked by required conditions
CI / test scripts (push) Blocked by required conditions
CI / ecosystem (push) Blocked by required conditions
CI / Fuzz for new ty panics (push) Blocked by required conditions
CI / cargo shear (push) Blocked by required conditions
CI / python package (push) Waiting to run
CI / pre-commit (push) Waiting to run
CI / mkdocs (push) Waiting to run
CI / formatter instabilities and black similarity (push) Blocked by required conditions
CI / test ruff-lsp (push) Blocked by required conditions
CI / check playground (push) Blocked by required conditions
CI / benchmarks-instrumented (push) Blocked by required conditions
CI / benchmarks-walltime (push) Blocked by required conditions
[ty Playground] Release / publish (push) Has been cancelled

When I try to grep CPython with `__super__` I get 0 results:

```
(.venv) ~/Desktop/cpython  main ✔                                                    
» ag __super__ . 
                
```

That's how we can understand that the naming is not the best.
This commit is contained in:
sobolevn 2025-06-18 20:57:57 +03:00 committed by GitHub
parent cb512ba80b
commit 2a425e43fd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 9 additions and 9 deletions

View file

@ -58,7 +58,7 @@ impl AlwaysFixableViolation for SuperCallWithParameters {
} }
fn fix_title(&self) -> String { fn fix_title(&self) -> String {
"Remove `__super__` parameters".to_string() "Remove `super()` parameters".to_string()
} }
} }

View file

@ -9,7 +9,7 @@ UP008.py:17:23: UP008 [*] Use `super()` instead of `super(__class__, self)`
18 | super(Child, self).method # wrong 18 | super(Child, self).method # wrong
19 | super( 19 | super(
| |
= help: Remove `__super__` parameters = help: Remove `super()` parameters
Unsafe fix Unsafe fix
14 14 | Parent.super(1, 2) # ok 14 14 | Parent.super(1, 2) # ok
@ -30,7 +30,7 @@ UP008.py:18:14: UP008 [*] Use `super()` instead of `super(__class__, self)`
19 | super( 19 | super(
20 | Child, 20 | Child,
| |
= help: Remove `__super__` parameters = help: Remove `super()` parameters
Unsafe fix Unsafe fix
15 15 | 15 15 |
@ -53,7 +53,7 @@ UP008.py:19:14: UP008 [*] Use `super()` instead of `super(__class__, self)`
22 | | ).method() # wrong 22 | | ).method() # wrong
| |_________^ UP008 | |_________^ UP008
| |
= help: Remove `__super__` parameters = help: Remove `super()` parameters
Unsafe fix Unsafe fix
16 16 | def wrong(self): 16 16 | def wrong(self):
@ -76,7 +76,7 @@ UP008.py:36:14: UP008 [*] Use `super()` instead of `super(__class__, self)`
| ^^^^^^^^^^^^^^^ UP008 | ^^^^^^^^^^^^^^^ UP008
37 | super().f() 37 | super().f()
| |
= help: Remove `__super__` parameters = help: Remove `super()` parameters
Unsafe fix Unsafe fix
33 33 | 33 33 |
@ -95,7 +95,7 @@ UP008.py:50:18: UP008 [*] Use `super()` instead of `super(__class__, self)`
| ^^^^^^^^^^^^^^^ UP008 | ^^^^^^^^^^^^^^^ UP008
51 | super().f() 51 | super().f()
| |
= help: Remove `__super__` parameters = help: Remove `super()` parameters
Unsafe fix Unsafe fix
47 47 | super(MyClass, self).f() # CANNOT use super() 47 47 | super(MyClass, self).f() # CANNOT use super()
@ -115,7 +115,7 @@ UP008.py:74:14: UP008 [*] Use `super()` instead of `super(__class__, self)`
| ^^^^^^^^^^^^^^^^^ UP008 | ^^^^^^^^^^^^^^^^^ UP008
75 | super().f() # OK 75 | super().f() # OK
| |
= help: Remove `__super__` parameters = help: Remove `super()` parameters
Unsafe fix Unsafe fix
71 71 | @dataclass 71 71 | @dataclass
@ -134,7 +134,7 @@ UP008.py:92:14: UP008 [*] Use `super()` instead of `super(__class__, self)`
92 | super(__class__, self).foo() 92 | super(__class__, self).foo()
| ^^^^^^^^^^^^^^^^^ UP008 | ^^^^^^^^^^^^^^^^^ UP008
| |
= help: Remove `__super__` parameters = help: Remove `super()` parameters
Unsafe fix Unsafe fix
89 89 | 89 89 |
@ -153,7 +153,7 @@ UP008.py:107:23: UP008 [*] Use `super()` instead of `super(__class__, self)`
107 | builtins.super(C, self) 107 | builtins.super(C, self)
| ^^^^^^^^^ UP008 | ^^^^^^^^^ UP008
| |
= help: Remove `__super__` parameters = help: Remove `super()` parameters
Unsafe fix Unsafe fix
104 104 | 104 104 |