---
source: crates/ruff_linter/src/rules/refurb/mod.rs
---
FURB166 [*] Use of `int` with explicit `base=2` after removing prefix
 --> FURB166.py:3:5
  |
1 | # Errors
2 |
3 | _ = int("0b1010"[2:], 2)
  |     ^^^^^^^^^^^^^^^^^^^^
4 | _ = int("0o777"[2:], 8)
5 | _ = int("0xFFFF"[2:], 16)
  |
help: Replace with `base=0`
  |
2 |
  - _ = int("0b1010"[2:], 2)
3 + _ = int("0b1010", 0)
4 | _ = int("0o777"[2:], 8)
  |
note: This is an unsafe fix and may change runtime behavior

FURB166 [*] Use of `int` with explicit `base=8` after removing prefix
 --> FURB166.py:4:5
  |
3 | _ = int("0b1010"[2:], 2)
4 | _ = int("0o777"[2:], 8)
  |     ^^^^^^^^^^^^^^^^^^^
5 | _ = int("0xFFFF"[2:], 16)
  |
help: Replace with `base=0`
  |
3 | _ = int("0b1010"[2:], 2)
  - _ = int("0o777"[2:], 8)
4 + _ = int("0o777", 0)
5 | _ = int("0xFFFF"[2:], 16)
  |
note: This is an unsafe fix and may change runtime behavior

FURB166 [*] Use of `int` with explicit `base=16` after removing prefix
 --> FURB166.py:5:5
  |
3 | _ = int("0b1010"[2:], 2)
4 | _ = int("0o777"[2:], 8)
5 | _ = int("0xFFFF"[2:], 16)
  |     ^^^^^^^^^^^^^^^^^^^^^
6 |
7 | b = "0b11"
  |
help: Replace with `base=0`
  |
4 | _ = int("0o777"[2:], 8)
  - _ = int("0xFFFF"[2:], 16)
5 + _ = int("0xFFFF", 0)
6 |
  |
note: This is an unsafe fix and may change runtime behavior

FURB166 [*] Use of `int` with explicit `base=2` after removing prefix
  --> FURB166.py:8:5
   |
 7 | b = "0b11"
 8 | _ = int(b[2:], 2)
   |     ^^^^^^^^^^^^^
 9 |
10 | _ = int("0xFFFF"[2:], base=16)
   |
help: Replace with `base=0`
  |
7 | b = "0b11"
  - _ = int(b[2:], 2)
8 + _ = int(b, 0)
9 |
  |
note: This is an unsafe fix and may change runtime behavior

FURB166 [*] Use of `int` with explicit `base=16` after removing prefix
  --> FURB166.py:10:5
   |
 8 | _ = int(b[2:], 2)
 9 |
10 | _ = int("0xFFFF"[2:], base=16)
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^
11 |
12 | _ = int(b"0xFFFF"[2:], 16)
   |
help: Replace with `base=0`
   |
9  |
   - _ = int("0xFFFF"[2:], base=16)
10 + _ = int("0xFFFF", base=0)
11 |
   |
note: This is an unsafe fix and may change runtime behavior

FURB166 [*] Use of `int` with explicit `base=16` after removing prefix
  --> FURB166.py:12:5
   |
10 | _ = int("0xFFFF"[2:], base=16)
11 |
12 | _ = int(b"0xFFFF"[2:], 16)
   |     ^^^^^^^^^^^^^^^^^^^^^^
   |
help: Replace with `base=0`
   |
11 |
   - _ = int(b"0xFFFF"[2:], 16)
12 + _ = int(b"0xFFFF", 0)
13 |
   |
note: This is an unsafe fix and may change runtime behavior

FURB166 [*] Use of `int` with explicit `base=16` after removing prefix
  --> FURB166.py:19:5
   |
19 | _ = int(get_str()[2:], 16)
   |     ^^^^^^^^^^^^^^^^^^^^^^
20 |
21 | # OK
   |
help: Replace with `base=0`
   |
18 |
   - _ = int(get_str()[2:], 16)
19 + _ = int(get_str(), 0)
20 |
   |
note: This is an unsafe fix and may change runtime behavior
