---
source: crates/ruff_linter/src/rules/flake8_annotations/mod.rs
---
ANN204 [*] Missing return type annotation for special method `__init__`
 --> mypy_init_return.py:5:9
  |
3 | # Error
4 | class Foo:
5 |     def __init__(self):
  |         ^^^^^^^^
6 |         ...
  |
help: Add return type annotation: `None`
  |
4 | class Foo:
  -     def __init__(self):
5 +     def __init__(self) -> None:
6 |         ...
  |
note: This is an unsafe fix and may change runtime behavior

ANN204 [*] Missing return type annotation for special method `__init__`
  --> mypy_init_return.py:11:9
   |
 9 | # Error
10 | class Foo:
11 |     def __init__(self, foo):
   |         ^^^^^^^^
12 |         ...
   |
help: Add return type annotation: `None`
   |
10 | class Foo:
   -     def __init__(self, foo):
11 +     def __init__(self, foo) -> None:
12 |         ...
   |
note: This is an unsafe fix and may change runtime behavior

ANN202 [*] Missing return type annotation for private function `__init__`
  --> mypy_init_return.py:40:5
   |
39 | # Error
40 | def __init__(self, foo: int):
   |     ^^^^^^^^
41 |     ...
   |
help: Add return type annotation: `None`
   |
39 | # Error
   - def __init__(self, foo: int):
40 + def __init__(self, foo: int) -> None:
41 |     ...
   |
note: This is an unsafe fix and may change runtime behavior

ANN204 [*] Missing return type annotation for special method `__init__`
  --> mypy_init_return.py:47:9
   |
45 | # of a vararg falsely indicated that the function has a typed argument.
46 | class Foo:
47 |     def __init__(self, *arg):
   |         ^^^^^^^^
48 |         ...
   |
help: Add return type annotation: `None`
   |
46 | class Foo:
   -     def __init__(self, *arg):
47 +     def __init__(self, *arg) -> None:
48 |         ...
   |
note: This is an unsafe fix and may change runtime behavior
