From a6604758eb2259a4a16e089f1a14d1e93cec42ba Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Mon, 9 Sep 2024 12:52:25 -0400 Subject: [PATCH] Add type annotations for _candidate_paths --- importlib_resources/readers.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/importlib_resources/readers.py b/importlib_resources/readers.py index abfcde7..7f0cff9 100644 --- a/importlib_resources/readers.py +++ b/importlib_resources/readers.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import collections import contextlib import itertools @@ -5,6 +7,7 @@ import operator import re import warnings +from collections.abc import Iterator from . import abc @@ -150,7 +153,7 @@ def _resolve(cls, path_str) -> abc.Traversable: return dir @classmethod - def _candidate_paths(cls, path_str): + def _candidate_paths(cls, path_str: str) -> Iterator[abc.Traversable]: yield pathlib.Path(path_str) yield from cls._resolve_zip_path(path_str)