Skip to content

Commit cf0a00d

Browse files
cyyeverpytorchmergebot
authored andcommitted
Enable ruff FURB161 rule (#164654)
This PR enables FURB161 in ruff. Pull Request resolved: #164654 Approved by: https://github.com/Skylion007
1 parent 5ed4270 commit cf0a00d

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,6 @@ ignore = [
187187
# TODO: Remove Python-3.10 specific suppressions
188188
"B905",
189189
"UP035",
190-
"FURB161",
191190
]
192191
select = [
193192
"B",

test/torch_np/numpy_tests/core/test_scalar_methods.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ class TestBitCount(TestCase):
235235
def test_small(self, itype):
236236
for a in range(max(np.iinfo(itype).min, 0), 128):
237237
msg = f"Smoke test for {itype}({a}).bit_count()"
238-
assert itype(a).bit_count() == bin(a).count("1"), msg
238+
assert itype(a).bit_count() == a.bit_count(), msg
239239

240240
def test_bit_count(self):
241241
for exp in [10, 17, 63]:

0 commit comments

Comments
 (0)