---
source: crates/ruff_linter/src/rules/flake8_pie/mod.rs
---
PIE794.py:4:5: PIE794 [*] Class field `name` is defined multiple times
  |
2 |     name = StringField()
3 |     # ....
4 |     name = StringField()  # PIE794
  |     ^^^^^^^^^^^^^^^^^^^^ PIE794
5 | 
6 |     def remove(self) -> None:
  |
  = help: Remove duplicate field definition for `name`

ℹ Unsafe fix
1 1 | class Foo(BaseModel):
2 2 |     name = StringField()
3 3 |     # ....
4   |-    name = StringField()  # PIE794
5 4 | 
6 5 |     def remove(self) -> None:
7 6 |         ...

PIE794.py:13:5: PIE794 [*] Class field `name` is defined multiple times
   |
11 |     name: str = StringField()
12 |     # ....
13 |     name = StringField()  # PIE794
   |     ^^^^^^^^^^^^^^^^^^^^ PIE794
14 | 
15 |     def foo(self) -> None:
   |
   = help: Remove duplicate field definition for `name`

ℹ Unsafe fix
10 10 | class Foo(BaseModel):
11 11 |     name: str = StringField()
12 12 |     # ....
13    |-    name = StringField()  # PIE794
14 13 | 
15 14 |     def foo(self) -> None:
16 15 |         ...

PIE794.py:23:5: PIE794 [*] Class field `bar` is defined multiple times
   |
21 |     foo: bool = BooleanField()
22 |     # ...
23 |     bar = StringField()  # PIE794
   |     ^^^^^^^^^^^^^^^^^^^ PIE794
   |
   = help: Remove duplicate field definition for `bar`

ℹ Unsafe fix
20 20 |     bar: str = StringField()
21 21 |     foo: bool = BooleanField()
22 22 |     # ...
23    |-    bar = StringField()  # PIE794
24 23 | 
25 24 | 
26 25 | class User(BaseModel):

PIE794.py:40:5: PIE794 [*] Class field `bar` is defined multiple times
   |
38 |     foo: bool = BooleanField()
39 |     # ...
40 |     bar = StringField()  # PIE794
   |     ^^^^^^^^^^^^^^^^^^^ PIE794
   |
   = help: Remove duplicate field definition for `bar`

ℹ Unsafe fix
37 37 |     bar: str = StringField()
38 38 |     foo: bool = BooleanField()
39 39 |     # ...
40    |-    bar = StringField()  # PIE794
41 40 | 
42 41 | 
43 42 | class Person:

PIE794.py:46:5: PIE794 [*] Class field `name` is defined multiple times
   |
44 |     name = "Foo"
45 |     name = name + " Bar"
46 |     name = "Bar"  # PIE794
   |     ^^^^^^^^^^^^ PIE794
   |
   = help: Remove duplicate field definition for `name`

ℹ Unsafe fix
43 43 | class Person:
44 44 |     name = "Foo"
45 45 |     name = name + " Bar"
46    |-    name = "Bar"  # PIE794
47 46 | 
48 47 | 
49 48 | class Person:

PIE794.py:52:5: PIE794 [*] Class field `name` is defined multiple times
   |
50 |     name: str = "Foo"
51 |     name: str = name + " Bar"
52 |     name: str = "Bar"  # PIE794
   |     ^^^^^^^^^^^^^^^^^ PIE794
   |
   = help: Remove duplicate field definition for `name`

ℹ Unsafe fix
49 49 | class Person:
50 50 |     name: str = "Foo"
51 51 |     name: str = name + " Bar"
52    |-    name: str = "Bar"  # PIE794


