---
source: crates/ruff_linter/src/rules/refurb/mod.rs
---
FURB189 [*] Subclassing `dict` can be error prone, use `collections.UserDict` instead
  --> FURB189.py:17:9
   |
16 | # positives
17 | class D(dict):
   |         ^^^^
18 |     pass
   |
help: Replace with `collections.UserDict`
   |
2  | from enum import Enum, EnumMeta
   - from collections import UserList as UL
3  + from collections import UserList as UL, UserDict
4  |
--------------------------------------------------------------------------------
16 | # positives
   - class D(dict):
17 + class D(UserDict):
18 |     pass
   |
note: This is an unsafe fix and may change runtime behavior

FURB189 [*] Subclassing `list` can be error prone, use `collections.UserList` instead
  --> FURB189.py:20:9
   |
18 |     pass
19 |
20 | class L(list):
   |         ^^^^
21 |     pass
   |
help: Replace with `collections.UserList`
   |
19 |
   - class L(list):
20 + class L(UL):
21 |     pass
   |
note: This is an unsafe fix and may change runtime behavior

FURB189 [*] Subclassing `str` can be error prone, use `collections.UserString` instead
  --> FURB189.py:23:9
   |
21 |     pass
22 |
23 | class S(str):
   |         ^^^
24 |     pass
   |
help: Replace with `collections.UserString`
   |
2  | from enum import Enum, EnumMeta
   - from collections import UserList as UL
3  + from collections import UserList as UL, UserString
4  |
--------------------------------------------------------------------------------
22 |
   - class S(str):
23 + class S(UserString):
24 |     pass
   |
note: This is an unsafe fix and may change runtime behavior

FURB189 [*] Subclassing `dict` can be error prone, use `collections.UserDict` instead
  --> FURB189.py:26:21
   |
24 |     pass
25 |
26 | class SubscriptDict(dict[str, str]):
   |                     ^^^^
27 |     pass
   |
help: Replace with `collections.UserDict`
   |
2  | from enum import Enum, EnumMeta
   - from collections import UserList as UL
3  + from collections import UserList as UL, UserDict
4  |
--------------------------------------------------------------------------------
25 |
   - class SubscriptDict(dict[str, str]):
26 + class SubscriptDict(UserDict[str, str]):
27 |     pass
   |
note: This is an unsafe fix and may change runtime behavior

FURB189 [*] Subclassing `list` can be error prone, use `collections.UserList` instead
  --> FURB189.py:29:21
   |
27 |     pass
28 |
29 | class SubscriptList(list[str]):
   |                     ^^^^
30 |     pass
   |
help: Replace with `collections.UserList`
   |
28 |
   - class SubscriptList(list[str]):
29 + class SubscriptList(UL[str]):
30 |     pass
   |
note: This is an unsafe fix and may change runtime behavior
