From a9a0d0a65eb297c7d5e9f55b992d37e6dd0f0c11 Mon Sep 17 00:00:00 2001 From: stumpylog <797416+stumpylog@users.noreply.github.com> Date: Thu, 23 Jul 2026 12:20:29 -0700 Subject: [PATCH] Fix: annotate ExportSink.stream's return type for pyrefly The abstract method had no return annotation, so pyrefly inferred -> None and flagged both DirectoryExportSink.stream and ZipExportSink.stream as incompatible overrides. --- src/documents/export/sinks.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/documents/export/sinks.py b/src/documents/export/sinks.py index d33002be7..91e15bc6e 100644 --- a/src/documents/export/sinks.py +++ b/src/documents/export/sinks.py @@ -86,8 +86,7 @@ class ExportSink(AbstractContextManager, abc.ABC): def add_json(self, content: list | dict, arcname: str) -> None: ... @abc.abstractmethod - def stream(self, arcname: str): # -> contextmanager yielding TextIO - ... + def stream(self, arcname: str) -> AbstractContextManager[TextIO]: ... def _open(self) -> None: """Hook called on context entry. Override as needed."""