@@ -807,14 +807,14 @@ FURB118.py:34:17: FURB118 [*] Use `operator.itemgetter((0, 1))` instead of defin
807
807
36 37 |
808
808
37 38 |
809
809
810
- FURB118 .py :35 :17 : FURB118 [* ] Use ` operator.itemgetter(( 0, 1) )` instead of defining a lambda
810
+ FURB118 .py :35 :17 : FURB118 [* ] Use ` operator.itemgetter(0, 1)` instead of defining a lambda
811
811
|
812
812
33 | op_itemgetter = lambda x : x [:]
813
813
34 | op_itemgetter = lambda x : x [0 , 1 ]
814
814
35 | op_itemgetter = lambda x : x [(0 , 1 )]
815
815
| ^^^^^^^^^^^^^^^^^^^ FURB118
816
816
|
817
- = help : Replace with ` operator.itemgetter(( 0, 1) )`
817
+ = help : Replace with ` operator.itemgetter(0, 1)`
818
818
819
819
ℹ Safe fix
820
820
1 1 | # Errors .
@@ -827,7 +827,7 @@ FURB118.py:35:17: FURB118 [*] Use `operator.itemgetter((0, 1))` instead of defin
827
827
33 34 | op_itemgetter = lambda x : x [:]
828
828
34 35 | op_itemgetter = lambda x : x [0 , 1 ]
829
829
35 | - op_itemgetter = lambda x : x [(0 , 1 )]
830
- 36 | + op_itemgetter = operator .itemgetter (( 0 , 1 ) )
830
+ 36 | + op_itemgetter = operator .itemgetter (0 , 1 )
831
831
36 37 |
832
832
37 38 |
833
833
38 39 | def op_not2 (x ):
@@ -847,3 +847,48 @@ FURB118.py:42:5: FURB118 Use `operator.add` instead of defining a function
847
847
43 | return x + y
848
848
|
849
849
= help: Replace with `operator.add`
850
+
851
+ FURB118.py:88:17: FURB118 [*] Use `operator.itemgetter((slice (None ), 1))` instead of defining a lambda
852
+ |
853
+ 87 | # See https:// github.com/astral-sh/ruff/issues/13508
854
+ 88 | op_itemgetter = lambda x: x[:, 1]
855
+ | ^^^^^^^^^^^^^^^^^ FURB118
856
+ 89 | op_itemgetter = lambda x: x[1, :]
857
+ |
858
+ = help: Replace with `operator.itemgetter((slice (None ), 1))`
859
+
860
+ ℹ Safe fix
861
+ 1 1 | # Errors.
862
+ 2 |+import operator
863
+ 2 3 | op_bitnot = lambda x: ~x
864
+ 3 4 | op_not = lambda x: not x
865
+ 4 5 | op_pos = lambda x: +x
866
+ --------------------------------------------------------------------------------
867
+ 85 86 | return x + y
868
+ 86 87 |
869
+ 87 88 | # See https:// github.com/astral-sh/ruff/issues/13508
870
+ 88 |-op_itemgetter = lambda x: x[:, 1]
871
+ 89 |+op_itemgetter = operator.itemgetter((slice (None ), 1))
872
+ 89 90 | op_itemgetter = lambda x: x[1, :]
873
+
874
+ FURB118.py:89:17: FURB118 [*] Use `operator.itemgetter((1, slice (None )))` instead of defining a lambda
875
+ |
876
+ 87 | # See https:// github.com/astral-sh/ruff/issues/13508
877
+ 88 | op_itemgetter = lambda x: x[:, 1]
878
+ 89 | op_itemgetter = lambda x: x[1, :]
879
+ | ^^^^^^^^^^^^^^^^^ FURB118
880
+ |
881
+ = help: Replace with `operator.itemgetter((1, slice (None )))`
882
+
883
+ ℹ Safe fix
884
+ 1 1 | # Errors.
885
+ 2 |+import operator
886
+ 2 3 | op_bitnot = lambda x: ~x
887
+ 3 4 | op_not = lambda x: not x
888
+ 4 5 | op_pos = lambda x: +x
889
+ --------------------------------------------------------------------------------
890
+ 86 87 |
891
+ 87 88 | # See https:// github.com/astral-sh/ruff/issues/13508
892
+ 88 89 | op_itemgetter = lambda x: x[:, 1]
893
+ 89 |-op_itemgetter = lambda x: x[1, :]
894
+ 90 |+op_itemgetter = operator.itemgetter((1, slice (None )))
0 commit comments