---
source: crates/ruff_linter/src/rules/ruff/mod.rs
---
RUF013 [*] PEP 484 prohibits implicit `Optional`
  --> RUF013_0.py:20:12
   |
20 | def f(arg: int = None):  # RUF013
   |            ^^^
21 |     pass
   |
help: Convert to `T | None`
   |
19 |
   - def f(arg: int = None):  # RUF013
20 + def f(arg: int | None = None):  # RUF013
21 |     pass
   |
note: This is an unsafe fix and may change runtime behavior

RUF013 [*] PEP 484 prohibits implicit `Optional`
  --> RUF013_0.py:24:12
   |
24 | def f(arg: str = None):  # RUF013
   |            ^^^
25 |     pass
   |
help: Convert to `T | None`
   |
23 |
   - def f(arg: str = None):  # RUF013
24 + def f(arg: str | None = None):  # RUF013
25 |     pass
   |
note: This is an unsafe fix and may change runtime behavior

RUF013 [*] PEP 484 prohibits implicit `Optional`
  --> RUF013_0.py:28:12
   |
28 | def f(arg: Tuple[str] = None):  # RUF013
   |            ^^^^^^^^^^
29 |     pass
   |
help: Convert to `T | None`
   |
27 |
   - def f(arg: Tuple[str] = None):  # RUF013
28 + def f(arg: Tuple[str] | None = None):  # RUF013
29 |     pass
   |
note: This is an unsafe fix and may change runtime behavior

RUF013 [*] PEP 484 prohibits implicit `Optional`
  --> RUF013_0.py:58:12
   |
58 | def f(arg: Union = None):  # RUF013
   |            ^^^^^
59 |     pass
   |
help: Convert to `T | None`
   |
57 |
   - def f(arg: Union = None):  # RUF013
58 + def f(arg: Union | None = None):  # RUF013
59 |     pass
   |
note: This is an unsafe fix and may change runtime behavior

RUF013 [*] PEP 484 prohibits implicit `Optional`
  --> RUF013_0.py:62:12
   |
62 | def f(arg: Union[int] = None):  # RUF013
   |            ^^^^^^^^^^
63 |     pass
   |
help: Convert to `T | None`
   |
61 |
   - def f(arg: Union[int] = None):  # RUF013
62 + def f(arg: Union[int] | None = None):  # RUF013
63 |     pass
   |
note: This is an unsafe fix and may change runtime behavior

RUF013 [*] PEP 484 prohibits implicit `Optional`
  --> RUF013_0.py:66:12
   |
66 | def f(arg: Union[int, str] = None):  # RUF013
   |            ^^^^^^^^^^^^^^^
67 |     pass
   |
help: Convert to `T | None`
   |
65 |
   - def f(arg: Union[int, str] = None):  # RUF013
66 + def f(arg: Union[int, str] | None = None):  # RUF013
67 |     pass
   |
note: This is an unsafe fix and may change runtime behavior

RUF013 [*] PEP 484 prohibits implicit `Optional`
  --> RUF013_0.py:85:12
   |
85 | def f(arg: int | float = None):  # RUF013
   |            ^^^^^^^^^^^
86 |     pass
   |
help: Convert to `T | None`
   |
84 |
   - def f(arg: int | float = None):  # RUF013
85 + def f(arg: int | float | None = None):  # RUF013
86 |     pass
   |
note: This is an unsafe fix and may change runtime behavior

RUF013 [*] PEP 484 prohibits implicit `Optional`
  --> RUF013_0.py:89:12
   |
89 | def f(arg: int | float | str | bytes = None):  # RUF013
   |            ^^^^^^^^^^^^^^^^^^^^^^^^^
90 |     pass
   |
help: Convert to `T | None`
   |
88 |
   - def f(arg: int | float | str | bytes = None):  # RUF013
89 + def f(arg: int | float | str | bytes | None = None):  # RUF013
90 |     pass
   |
note: This is an unsafe fix and may change runtime behavior

RUF013 [*] PEP 484 prohibits implicit `Optional`
   --> RUF013_0.py:108:12
    |
108 | def f(arg: Literal[1] = None):  # RUF013
    |            ^^^^^^^^^^
109 |     pass
    |
help: Convert to `T | None`
    |
107 |
    - def f(arg: Literal[1] = None):  # RUF013
108 + def f(arg: Literal[1] | None = None):  # RUF013
109 |     pass
    |
note: This is an unsafe fix and may change runtime behavior

RUF013 [*] PEP 484 prohibits implicit `Optional`
   --> RUF013_0.py:112:12
    |
112 | def f(arg: Literal[1, "foo"] = None):  # RUF013
    |            ^^^^^^^^^^^^^^^^^
113 |     pass
    |
help: Convert to `T | None`
    |
111 |
    - def f(arg: Literal[1, "foo"] = None):  # RUF013
112 + def f(arg: Literal[1, "foo"] | None = None):  # RUF013
113 |     pass
    |
note: This is an unsafe fix and may change runtime behavior

RUF013 [*] PEP 484 prohibits implicit `Optional`
   --> RUF013_0.py:131:22
    |
131 | def f(arg: Annotated[int, ...] = None):  # RUF013
    |                      ^^^
132 |     pass
    |
help: Convert to `T | None`
    |
130 |
    - def f(arg: Annotated[int, ...] = None):  # RUF013
131 + def f(arg: Annotated[int | None, ...] = None):  # RUF013
132 |     pass
    |
note: This is an unsafe fix and may change runtime behavior

RUF013 [*] PEP 484 prohibits implicit `Optional`
   --> RUF013_0.py:135:32
    |
135 | def f(arg: Annotated[Annotated[int | str, ...], ...] = None):  # RUF013
    |                                ^^^^^^^^^
136 |     pass
    |
help: Convert to `T | None`
    |
134 |
    - def f(arg: Annotated[Annotated[int | str, ...], ...] = None):  # RUF013
135 + def f(arg: Annotated[Annotated[int | str | None, ...], ...] = None):  # RUF013
136 |     pass
    |
note: This is an unsafe fix and may change runtime behavior

RUF013 [*] PEP 484 prohibits implicit `Optional`
   --> RUF013_0.py:151:11
    |
150 | def f(
151 |     arg1: int = None,  # RUF013
    |           ^^^
152 |     arg2: Union[int, float] = None,  # RUF013
153 |     arg3: Literal[1, 2, 3] = None,  # RUF013
    |
help: Convert to `T | None`
    |
150 | def f(
    -     arg1: int = None,  # RUF013
151 +     arg1: int | None = None,  # RUF013
152 |     arg2: Union[int, float] = None,  # RUF013
    |
note: This is an unsafe fix and may change runtime behavior

RUF013 [*] PEP 484 prohibits implicit `Optional`
   --> RUF013_0.py:152:11
    |
150 | def f(
151 |     arg1: int = None,  # RUF013
152 |     arg2: Union[int, float] = None,  # RUF013
    |           ^^^^^^^^^^^^^^^^^
153 |     arg3: Literal[1, 2, 3] = None,  # RUF013
154 | ):
    |
help: Convert to `T | None`
    |
151 |     arg1: int = None,  # RUF013
    -     arg2: Union[int, float] = None,  # RUF013
152 +     arg2: Union[int, float] | None = None,  # RUF013
153 |     arg3: Literal[1, 2, 3] = None,  # RUF013
    |
note: This is an unsafe fix and may change runtime behavior

RUF013 [*] PEP 484 prohibits implicit `Optional`
   --> RUF013_0.py:153:11
    |
151 |     arg1: int = None,  # RUF013
152 |     arg2: Union[int, float] = None,  # RUF013
153 |     arg3: Literal[1, 2, 3] = None,  # RUF013
    |           ^^^^^^^^^^^^^^^^
154 | ):
155 |     pass
    |
help: Convert to `T | None`
    |
152 |     arg2: Union[int, float] = None,  # RUF013
    -     arg3: Literal[1, 2, 3] = None,  # RUF013
153 +     arg3: Literal[1, 2, 3] | None = None,  # RUF013
154 | ):
    |
note: This is an unsafe fix and may change runtime behavior

RUF013 [*] PEP 484 prohibits implicit `Optional`
   --> RUF013_0.py:181:12
    |
181 | def f(arg: Union[Annotated[int, ...], Union[str, bytes]] = None):  # RUF013
    |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
182 |     pass
    |
help: Convert to `T | None`
    |
180 |
    - def f(arg: Union[Annotated[int, ...], Union[str, bytes]] = None):  # RUF013
181 + def f(arg: Union[Annotated[int, ...], Union[str, bytes]] | None = None):  # RUF013
182 |     pass
    |
note: This is an unsafe fix and may change runtime behavior

RUF013 [*] PEP 484 prohibits implicit `Optional`
   --> RUF013_0.py:188:13
    |
188 | def f(arg: "int" = None):  # RUF013
    |             ^^^
189 |     pass
    |
help: Convert to `T | None`
    |
187 |
    - def f(arg: "int" = None):  # RUF013
188 + def f(arg: "int | None" = None):  # RUF013
189 |     pass
    |
note: This is an unsafe fix and may change runtime behavior

RUF013 [*] PEP 484 prohibits implicit `Optional`
   --> RUF013_0.py:192:13
    |
192 | def f(arg: "str" = None):  # RUF013
    |             ^^^
193 |     pass
    |
help: Convert to `T | None`
    |
191 |
    - def f(arg: "str" = None):  # RUF013
192 + def f(arg: "str | None" = None):  # RUF013
193 |     pass
    |
note: This is an unsafe fix and may change runtime behavior

RUF013 PEP 484 prohibits implicit `Optional`
   --> RUF013_0.py:196:12
    |
196 | def f(arg: "st" "r" = None):  # RUF013
    |            ^^^^^^^^
197 |     pass
    |
help: Convert to `T | None`

RUF013 [*] PEP 484 prohibits implicit `Optional`
   --> RUF013_0.py:204:12
    |
204 | def f(arg: Union["int", "str"] = None):  # RUF013
    |            ^^^^^^^^^^^^^^^^^^^
205 |     pass
    |
help: Convert to `T | None`
    |
203 |
    - def f(arg: Union["int", "str"] = None):  # RUF013
204 + def f(arg: Union["int", "str"] | None = None):  # RUF013
205 |     pass
    |
note: This is an unsafe fix and may change runtime behavior
