Created
September 17, 2021 22:39
-
-
Save mypy-play/faa66ac61b63d292f5078b254707acf7 to your computer and use it in GitHub Desktop.
Shared via mypy Playground
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import annotations | |
from collections.abc import Sequence | |
from os import PathLike | |
from pathlib import Path | |
from typing import Any, BinaryIO, TextIO, Union | |
FileDesignator = Union[PathLike[Any], str, bytes] | |
FileHandle = Union[TextIO, BinaryIO] | |
input_files: Sequence[FileDesignator] | |
input_sources: Sequence[FileDesignator | FileHandle] | |
if input_files: | |
input_sources = list(map(Path, input_files)) | |
else: | |
input_sources = [sys.stdin] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment