---
source: crates/ruff_linter/src/rules/flake8_pyi/mod.rs
---
PYI029 [*] Defining `__str__` in a stub is almost always redundant
  --> PYI029.pyi:10:9
   |
 9 | class ShouldRemoveSingle:
10 |     def __str__(self) -> builtins.str: ...  # Error: PYI029
   |         ^^^^^^^
11 |
12 | class ShouldRemove:
   |
help: Remove definition of `__str__`
   |
9  | class ShouldRemoveSingle:
   -     def __str__(self) -> builtins.str: ...  # Error: PYI029
10 +     pass  # Error: PYI029
11 |
   |

PYI029 [*] Defining `__repr__` in a stub is almost always redundant
  --> PYI029.pyi:13:9
   |
12 | class ShouldRemove:
13 |     def __repr__(self) -> str: ...  # Error: PYI029
   |         ^^^^^^^^
14 |     def __str__(self) -> builtins.str: ...  # Error: PYI029
   |
help: Remove definition of `__repr__`
   |
12 | class ShouldRemove:
   -     def __repr__(self) -> str: ...  # Error: PYI029
13 |     def __str__(self) -> builtins.str: ...  # Error: PYI029
   |

PYI029 [*] Defining `__str__` in a stub is almost always redundant
  --> PYI029.pyi:14:9
   |
12 | class ShouldRemove:
13 |     def __repr__(self) -> str: ...  # Error: PYI029
14 |     def __str__(self) -> builtins.str: ...  # Error: PYI029
   |         ^^^^^^^
15 |
16 | class NoReturnSpecified:
   |
help: Remove definition of `__str__`
   |
13 |     def __repr__(self) -> str: ...  # Error: PYI029
   -     def __str__(self) -> builtins.str: ...  # Error: PYI029
14 |
   |
