Skip to content

Commit 90ff72b

Browse files
committed
bunch of tweaks
1 parent f112dbf commit 90ff72b

3 files changed

Lines changed: 538 additions & 325 deletions

File tree

crates/ruff_linter/resources/test/fixtures/pylint/unnecessary_dunder_call.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
from typing import Any
2+
3+
14
print((3.0).__add__(4.0)) # PLC2801
25
print((3.0).__sub__(4.0)) # PLC2801
36
print((3.0).__mul__(4.0)) # PLC2801
@@ -13,8 +16,12 @@
1316
print((3.0).__str__()) # PLC2801
1417
print((3.0).__repr__()) # PLC2801
1518
print([1, 2, 3].__len__()) # PLC2801
19+
print((1).__neg__()) # PLC2801
1620

1721

1822
class Thing:
19-
def __init__(self) -> None:
23+
def __init__(self, stuff: Any) -> None:
2024
super().__init__() # Ok
25+
super().__class__(stuff=(1, 2, 3)) # Ok
26+
27+
blah = lambda: {"a": 1}.__delitem__("a") # Ok

0 commit comments

Comments
 (0)