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

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

class_as_data_structure.py:45:1: B903 Class could be dataclass or namedtuple
   |
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
   | |__________________^ B903
50 |   
51 |   # <--- begin flake8-bugbear tests below
   |

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

class_as_data_structure.py:91:1: B903 Class could be dataclass or namedtuple
   |
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
   | |______________________^ B903
97 |   
98 |   # <-- end flake8-bugbear tests
   |
