From e9242816a57428e6bb332798039bf5a2ed1ea708 Mon Sep 17 00:00:00 2001 From: Artyom Date: Thu, 29 Oct 2026 23:12:45 +0300 Subject: [PATCH] Drop the type ignore comment from error classification ty accepts the lookup without it, and the project keeps code free of comments. Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_01V1d3RLHNBBMA6UqBLLJv27 --- openspec/changes/close-lab3-review-gaps/tasks.md | 2 +- src/messenger/shared/entrypoints/errors.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/openspec/changes/close-lab3-review-gaps/tasks.md b/openspec/changes/close-lab3-review-gaps/tasks.md index 753fb1b2..10f44728 100644 --- a/openspec/changes/close-lab3-review-gaps/tasks.md +++ b/openspec/changes/close-lab3-review-gaps/tasks.md @@ -1,7 +1,7 @@ ## 1. Требования и код - [x] 1.1 Тест порядка проверок `POST …/messages` для постороннего (`test_request_shape_is_checked_before_access`) -- [ ] 1.2 Убрать `# type: ignore` из `shared/entrypoints/errors.py` +- [x] 1.2 Убрать `# type: ignore` из `shared/entrypoints/errors.py` - [ ] 1.3 `openspec/config.yaml`: `gunicorn_conf.py` в карте модулей - [ ] 1.4 Проверка группы: `make lint`, `make student-test`, `make check` diff --git a/src/messenger/shared/entrypoints/errors.py b/src/messenger/shared/entrypoints/errors.py index e32c6e72..5efde313 100644 --- a/src/messenger/shared/entrypoints/errors.py +++ b/src/messenger/shared/entrypoints/errors.py @@ -46,7 +46,7 @@ class Unauthenticated(Exception): def classify(error: DomainError, codes: ErrorCodes) -> tuple[str, int]: for kind in type(error).__mro__: - known = codes.get(kind) # type: ignore[arg-type] + known = codes.get(kind) if known is not None: return known return "internal_error", status.HTTP_500_INTERNAL_SERVER_ERROR