From 66770bc798de5efc648bb4992f130c628c97e11b Mon Sep 17 00:00:00 2001 From: hideyukiMORI Date: Wed, 20 May 2026 00:43:59 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20note=20/=20tag=20=E3=81=AE=20Input?= =?UTF-8?q?=E3=83=BBOutput=20dataclass=20=E3=81=AB=20slots=3DTrue=20?= =?UTF-8?q?=E3=82=92=E8=BF=BD=E5=8A=A0=20(#110)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CLAUDE.md の規約「dataclass(frozen=True, slots=True)」に合わせて note/use_case.py と tag/use_case.py の全 dataclass を修正。 comment/use_case.py はすでに slots=True を使用しており変更なし。 Co-Authored-By: Claude Sonnet 4.6 --- src/example/note/use_case.py | 10 +++++----- src/example/tag/use_case.py | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/example/note/use_case.py b/src/example/note/use_case.py index 7a767c4..ff1bc4b 100644 --- a/src/example/note/use_case.py +++ b/src/example/note/use_case.py @@ -7,13 +7,13 @@ from .repository import NoteRepositoryInterface -@dataclass(frozen=True) +@dataclass(frozen=True, slots=True) class ListNotesInput: limit: int offset: int -@dataclass(frozen=True) +@dataclass(frozen=True, slots=True) class ListNotesOutput: items: list[Note] limit: int @@ -36,7 +36,7 @@ def execute(self, input_: ListNotesInput) -> ListNotesOutput: ) -@dataclass(frozen=True) +@dataclass(frozen=True, slots=True) class CreateNoteInput: title: str body: str @@ -61,7 +61,7 @@ def execute(self, note_id: int) -> Note: return note -@dataclass(frozen=True) +@dataclass(frozen=True, slots=True) class UpdateNoteInput: note_id: int title: str @@ -79,7 +79,7 @@ def execute(self, input_: UpdateNoteInput) -> Note: return note -@dataclass(frozen=True) +@dataclass(frozen=True, slots=True) class DeleteNoteInput: note_id: int diff --git a/src/example/tag/use_case.py b/src/example/tag/use_case.py index cb0e4a5..1c429c6 100644 --- a/src/example/tag/use_case.py +++ b/src/example/tag/use_case.py @@ -7,13 +7,13 @@ from .repository import TagRepositoryInterface -@dataclass(frozen=True) +@dataclass(frozen=True, slots=True) class ListTagsInput: limit: int offset: int -@dataclass(frozen=True) +@dataclass(frozen=True, slots=True) class ListTagsOutput: items: list[Tag] limit: int @@ -47,7 +47,7 @@ def execute(self, tag_id: int) -> Tag: return tag -@dataclass(frozen=True) +@dataclass(frozen=True, slots=True) class CreateTagInput: name: str @@ -60,7 +60,7 @@ def execute(self, input_: CreateTagInput) -> Tag: return self._repository.save(input_.name) -@dataclass(frozen=True) +@dataclass(frozen=True, slots=True) class UpdateTagInput: tag_id: int name: str @@ -77,7 +77,7 @@ def execute(self, input_: UpdateTagInput) -> Tag: return tag -@dataclass(frozen=True) +@dataclass(frozen=True, slots=True) class DeleteTagInput: tag_id: int