mirror of
https://github.com/astral-sh/ruff.git
synced 2025-11-03 05:13:00 +00:00
[pyupgrade] Fix super(__class__, self) detection in UP008 (super-call-with-parameters) (#18478)
This commit is contained in:
parent
ef4108af2a
commit
dbb0d60caa
3 changed files with 31 additions and 3 deletions
|
|
@ -79,3 +79,14 @@ class DataClass:
|
|||
def normal(self):
|
||||
super(DataClass, self).f() # OK
|
||||
super().f() # OK (`TypeError` in practice)
|
||||
|
||||
|
||||
# see: https://github.com/astral-sh/ruff/issues/18477
|
||||
class A:
|
||||
def foo(self):
|
||||
pass
|
||||
|
||||
|
||||
class B(A):
|
||||
def bar(self):
|
||||
super(__class__, self).foo()
|
||||
Loading…
Add table
Add a link
Reference in a new issue