---
source: crates/ruff_linter/src/rules/flake8_bugbear/mod.rs
---
B903 Class could be dataclass or namedtuple
 --> class_as_data_structure.py:6:1
  |
6 | / class Point:  # B903
7 | |     def __init__(self, x: float, y: float) -> None:
8 | |         self.x = x
9 | |         self.y = y
  | |__________________^
  |

B903 Class could be dataclass or namedtuple
  --> class_as_data_structure.py:40:1
   |
38 |           ...
39 |
40 | / class C:   # B903
41 | |     c: int
42 | |     def __init__(self,d:list):
43 | |         self.d = d
   | |__________________^
44 |
45 |   class D:   # B903
   |

B903 Class could be dataclass or namedtuple
  --> class_as_data_structure.py:45:1
   |
43 |           self.d = d
44 |
45 | / class D:   # B903
46 | |     """This class has a docstring."""
47 | |     # this next method is an init
48 | |     def __init__(self,e:dict):
49 | |         self.e = e
   | |__________________^
50 |
51 |   # <--- begin flake8-bugbear tests below
   |

B903 Class could be dataclass or namedtuple
  --> class_as_data_structure.py:63:1
   |
63 | / class NoWarningsClassAttributes:
64 | |     spam = "ham"
65 | |
66 | |     def __init__(self, foo:int, bar:list):
67 | |         self.foo = foo
68 | |         self.bar = bar
   | |______________________^
   |

B903 Class could be dataclass or namedtuple
  --> class_as_data_structure.py:85:1
   |
85 | / class Warnings:
86 | |     def __init__(self, foo:int, bar:list):
87 | |         self.foo = foo
88 | |         self.bar = bar
   | |______________________^
   |

B903 Class could be dataclass or namedtuple
  --> class_as_data_structure.py:91:1
   |
91 | / class WarningsWithDocstring:
92 | |     """A docstring should not be an impediment to a warning"""
93 | |
94 | |     def __init__(self, foo:int, bar:list):
95 | |         self.foo = foo
96 | |         self.bar = bar
   | |______________________^
   |
