---
source: crates/ruff_linter/src/rules/ruff/mod.rs
---
RUF036 [*] `None` not at the end of the type union.
 --> RUF036.pyi:4:16
  |
4 | def func1(arg: None | int): ...
  |                ^^^^^^^^^^
5 |
6 | def func2() -> None | int: ...
  |
help: Move `None` to the end of the type union
  |
3 |
  - def func1(arg: None | int): ...
4 + def func1(arg: int | None): ...
5 |
  |

RUF036 [*] `None` not at the end of the type union.
 --> RUF036.pyi:6:16
  |
4 | def func1(arg: None | int): ...
5 |
6 | def func2() -> None | int: ...
  |                ^^^^^^^^^^
7 |
8 | def func3(arg: None | None | int): ...
  |
help: Move `None` to the end of the type union
  |
5 |
  - def func2() -> None | int: ...
6 + def func2() -> int | None: ...
7 |
  |

RUF036 `None` not at the end of the type union.
  --> RUF036.pyi:8:16
   |
 6 | def func2() -> None | int: ...
 7 |
 8 | def func3(arg: None | None | int): ...
   |                ^^^^^^^^^^^^^^^^^
 9 |
10 | def func4(arg: U[None, int]): ...
   |
help: Move `None` to the end of the type union

RUF036 [*] `None` not at the end of the type union.
  --> RUF036.pyi:10:16
   |
 8 | def func3(arg: None | None | int): ...
 9 |
10 | def func4(arg: U[None, int]): ...
   |                ^^^^^^^^^^^^
11 |
12 | def func5() -> U[None, int]: ...
   |
help: Move `None` to the end of the type union
   |
9  |
   - def func4(arg: U[None, int]): ...
10 + def func4(arg: U[int, None]): ...
11 |
   |

RUF036 [*] `None` not at the end of the type union.
  --> RUF036.pyi:12:16
   |
10 | def func4(arg: U[None, int]): ...
11 |
12 | def func5() -> U[None, int]: ...
   |                ^^^^^^^^^^^^
13 |
14 | def func6(arg: U[None, None, int]): ...
   |
help: Move `None` to the end of the type union
   |
11 |
   - def func5() -> U[None, int]: ...
12 + def func5() -> U[int, None]: ...
13 |
   |

RUF036 [*] `None` not at the end of the type union.
  --> RUF036.pyi:14:16
   |
12 | def func5() -> U[None, int]: ...
13 |
14 | def func6(arg: U[None, None, int]): ...
   |                ^^^^^^^^^^^^^^^^^^
15 |
16 | # Nested unions - no fix should be provided
   |
help: Move `None` to the end of the type union
   |
13 |
   - def func6(arg: U[None, None, int]): ...
14 + def func6(arg: U[int, None, None]): ...
15 |
   |

RUF036 `None` not at the end of the type union.
  --> RUF036.pyi:17:14
   |
16 | # Nested unions - no fix should be provided
17 | def func7(x: None | U[None, int]): ...
   |              ^^^^^^^^^^^^^^^^^^^
18 |
19 | def func8(x: U[int, U[None, list | set]]): ...
   |
help: Move `None` to the end of the type union

RUF036 `None` not at the end of the type union.
  --> RUF036.pyi:19:14
   |
17 | def func7(x: None | U[None, int]): ...
18 |
19 | def func8(x: U[int, U[None, list | set]]): ...
   |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^
20 |
21 | # Multiple annotations in the same function
   |
help: Move `None` to the end of the type union

RUF036 [*] `None` not at the end of the type union.
  --> RUF036.pyi:22:14
   |
21 | # Multiple annotations in the same function
22 | def func9(x: None | int) -> None | int: ...
   |              ^^^^^^^^^^
23 |
24 | # 3+ member PEP 604 chains
   |
help: Move `None` to the end of the type union
   |
21 | # Multiple annotations in the same function
   - def func9(x: None | int) -> None | int: ...
22 + def func9(x: int | None) -> None | int: ...
23 |
   |

RUF036 [*] `None` not at the end of the type union.
  --> RUF036.pyi:22:29
   |
21 | # Multiple annotations in the same function
22 | def func9(x: None | int) -> None | int: ...
   |                             ^^^^^^^^^^
23 |
24 | # 3+ member PEP 604 chains
   |
help: Move `None` to the end of the type union
   |
21 | # Multiple annotations in the same function
   - def func9(x: None | int) -> None | int: ...
22 + def func9(x: None | int) -> int | None: ...
23 |
   |

RUF036 [*] `None` not at the end of the type union.
  --> RUF036.pyi:25:17
   |
24 | # 3+ member PEP 604 chains
25 | def func10(arg: None | int | str): ...
   |                 ^^^^^^^^^^^^^^^^
26 |
27 | def func11(arg: None | int | str | bytes): ...
   |
help: Move `None` to the end of the type union
   |
24 | # 3+ member PEP 604 chains
   - def func10(arg: None | int | str): ...
25 + def func10(arg: int | str | None): ...
26 |
   |

RUF036 [*] `None` not at the end of the type union.
  --> RUF036.pyi:27:17
   |
25 | def func10(arg: None | int | str): ...
26 |
27 | def func11(arg: None | int | str | bytes): ...
   |                 ^^^^^^^^^^^^^^^^^^^^^^^^
28 |
29 | # Ok
   |
help: Move `None` to the end of the type union
   |
26 |
   - def func11(arg: None | int | str | bytes): ...
27 + def func11(arg: int | str | bytes | None): ...
28 |
   |
