---
source: crates/ruff_linter/src/rules/ruff/mod.rs
---
RUF038 [*] `Literal[True, False]` can be replaced with `bool`
 --> RUF038.pyi:4:17
  |
4 | def func1(arg1: Literal[True, False]): ...
  |                 ^^^^^^^^^^^^^^^^^^^^
5 |
6 | def func2(arg1: Literal[True, False, True]): ...
  |
help: Replace with `bool`
  |
3 |
  - def func1(arg1: Literal[True, False]): ...
4 + def func1(arg1: bool): ...
5 |
  |
note: This is an unsafe fix and may change runtime behavior

RUF038 [*] `Literal[True, False]` can be replaced with `bool`
 --> RUF038.pyi:6:17
  |
4 | def func1(arg1: Literal[True, False]): ...
5 |
6 | def func2(arg1: Literal[True, False, True]): ...
  |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^
7 |
8 | def func3() -> Literal[True, False]: ...
  |
help: Replace with `bool`
  |
5 |
  - def func2(arg1: Literal[True, False, True]): ...
6 + def func2(arg1: bool): ...
7 |
  |
note: This is an unsafe fix and may change runtime behavior

RUF038 [*] `Literal[True, False]` can be replaced with `bool`
  --> RUF038.pyi:8:16
   |
 6 | def func2(arg1: Literal[True, False, True]): ...
 7 |
 8 | def func3() -> Literal[True, False]: ...
   |                ^^^^^^^^^^^^^^^^^^^^
 9 |
10 | def func4(arg1: Literal[True, False] | bool): ...
   |
help: Replace with `bool`
  |
7 |
  - def func3() -> Literal[True, False]: ...
8 + def func3() -> bool: ...
9 |
  |
note: This is an unsafe fix and may change runtime behavior

RUF038 [*] `Literal[True, False]` can be replaced with `bool`
  --> RUF038.pyi:10:17
   |
 8 | def func3() -> Literal[True, False]: ...
 9 |
10 | def func4(arg1: Literal[True, False] | bool): ...
   |                 ^^^^^^^^^^^^^^^^^^^^
11 |
12 | def func5(arg1: Literal[False, True]): ...
   |
help: Replace with `bool`
   |
9  |
   - def func4(arg1: Literal[True, False] | bool): ...
10 + def func4(arg1: bool | bool): ...
11 |
   |
note: This is an unsafe fix and may change runtime behavior

RUF038 [*] `Literal[True, False]` can be replaced with `bool`
  --> RUF038.pyi:12:17
   |
10 | def func4(arg1: Literal[True, False] | bool): ...
11 |
12 | def func5(arg1: Literal[False, True]): ...
   |                 ^^^^^^^^^^^^^^^^^^^^
13 |
14 | def func6(arg1: Literal[True, False, "hello", "world"]): ...
   |
help: Replace with `bool`
   |
11 |
   - def func5(arg1: Literal[False, True]): ...
12 + def func5(arg1: bool): ...
13 |
   |
note: This is an unsafe fix and may change runtime behavior

RUF038 `Literal[True, False, ...]` can be replaced with `Literal[...] | bool`
  --> RUF038.pyi:14:17
   |
12 | def func5(arg1: Literal[False, True]): ...
13 |
14 | def func6(arg1: Literal[True, False, "hello", "world"]): ...
   |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
15 |
16 | # ok
   |
help: Replace with `Literal[...] | bool`
