Skip to content

Instantly share code, notes, and snippets.

@mypy-play
Created May 15, 2024 13:49
Show Gist options
  • Save mypy-play/cd1d59c032e057a1950120e8307c7ead to your computer and use it in GitHub Desktop.
Save mypy-play/cd1d59c032e057a1950120e8307c7ead to your computer and use it in GitHub Desktop.
Shared via mypy Playground
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