summaryrefslogtreecommitdiff
path: root/doc/data/messages/c/consider-using-namedtuple-or-dataclass/good.py
blob: b13713f597ee45cbeeea560e13f3bddcab8bc92a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
from typing import NamedTuple


class FelidaeCharacteristics(NamedTuple):
    tail_length_cm: int
    paws: int
    eyes: int
    hat: str | None


FELIDAES = {
    "The queen's cymric, fragile furry friend": FelidaeCharacteristics(
        tail_length_cm=1, paws=4, eyes=2, hat="Elizabethan collar"
    ),
    "Rackat the red, terror of the sea": FelidaeCharacteristics(
        tail_length_cm=21, paws=3, eyes=1, hat="Red Hat"
    ),
}