Created
May 15, 2024 13:49
-
-
Save mypy-play/cd1d59c032e057a1950120e8307c7ead 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
import os | |
from pathlib import Path | |
def foo() -> list[str|os.PathLike[str]]: | |
return ["a", "b", Path("/tmp")] | |
def main() -> None: | |
cmd_line = foo() | |
file = cmd_line[0] | |
args = cmd_line[1:] | |
test : list[str| Path] = foo() | |
os.execvp( | |
file=file, | |
args=args, | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment