---
source: crates/ruff_linter/src/rules/flake8_slots/mod.rs
snapshot_kind: text
---
SLOT002.py:6:7: SLOT002 Subclasses of `collections.namedtuple()` should define `__slots__`
  |
6 | class Bad(namedtuple("foo", ["str", "int"])):  # SLOT002
  |       ^^^ SLOT002
7 |     pass
  |

SLOT002.py:10:7: SLOT002 Subclasses of call-based `typing.NamedTuple()` should define `__slots__`
   |
10 | class UnusualButStillBad(NamedTuple("foo", [("x", int, "y", int)])):  # SLOT002
   |       ^^^^^^^^^^^^^^^^^^ SLOT002
11 |     pass
   |

SLOT002.py:30:7: SLOT002 Subclasses of `collections.namedtuple()` should define `__slots__`
   |
30 | class UnusualButStillBad(namedtuple("foo", ["str", "int"]), NamedTuple("foo", [("x", int, "y", int)])):
   |       ^^^^^^^^^^^^^^^^^^ SLOT002
31 |     pass
   |

SLOT002.py:34:7: SLOT002 Subclasses of `collections.namedtuple()` should define `__slots__`
   |
34 | class UnusualButStillBad(namedtuple("foo", ["str", "int"]), object):
   |       ^^^^^^^^^^^^^^^^^^ SLOT002
35 |     pass
   |
