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

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

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