chore: initialize containerized Python learning workbook (2026 DevOps/SRE)

This commit is contained in:
soda64 committed 2026-11-30 22:55:56 +01:00
commit ae4c421815
63 files changed
+1273

No files matched your search

@@ -0,0 +1,42 @@
from dataclasses import dataclass
class InvalidTitleError(ValueError):
pass
class TaskNotFoundError(KeyError):
pass
@dataclass
class Task:
id: int
title: str
done: bool = False
class TaskStore:
def __init__(self) -> None:
self._next_id = 1
self._tasks: dict[int, Task] = {}
def create(self, title: str) -> Task:
raise NotImplementedError("Zwaliduj tytuł, utwórz Task z auto-ID i zapisz")
def get(self, task_id: int) -> Task | None:
raise NotImplementedError("Zwróć Task lub None")
def list_all(self) -> list[Task]:
raise NotImplementedError("Zwróć wszystkie zadania posortowane po id")
def update_title(self, task_id: int, title: str) -> Task:
raise NotImplementedError(
"Zaktualizuj tytuł lub rzuć InvalidTitleError / TaskNotFoundError"
)
def mark_done(self, task_id: int) -> Task:
raise NotImplementedError("Ustaw done=True lub rzuć TaskNotFoundError")
def delete(self, task_id: int) -> Task:
raise NotImplementedError("Usuń i zwróć zadanie lub rzuć TaskNotFoundError")