From bfc74eb9a28c31b8678ea1abf32f71ecdd860256 Mon Sep 17 00:00:00 2001 From: Kyle O'Malley Date: Mon, 12 Oct 2026 22:03:59 -0400 Subject: [PATCH] refactor: annotate open_source as a Generator ty 0.0.85 deprecates annotating a @contextmanager function as returning Iterator, which fails the typecheck step on the Dependabot bump in #73. --- src/sillystrings/cli.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sillystrings/cli.py b/src/sillystrings/cli.py index 4ba88a6..5e2dd86 100644 --- a/src/sillystrings/cli.py +++ b/src/sillystrings/cli.py @@ -4,7 +4,7 @@ import mmap import os import sys -from collections.abc import Iterator +from collections.abc import Generator from dataclasses import dataclass from pathlib import Path from typing import get_args @@ -42,7 +42,7 @@ class Source: @contextlib.contextmanager -def open_source(name: str) -> Iterator[Source]: +def open_source(name: str) -> Generator[Source]: """Open a file, or stdin for "-", as a Source valid for the with block. Files are memory-mapped rather than read, so the OS pages them in as the