Skip to content

Instantly share code, notes, and snippets.

@mypy-play
Created May 15, 2024 14:07
Show Gist options
  • Save mypy-play/967fb464c22d1079ad748b988003eaaa to your computer and use it in GitHub Desktop.
Save mypy-play/967fb464c22d1079ad748b988003eaaa to your computer and use it in GitHub Desktop.
Shared via mypy Playground
import os
from pathlib import Path
def foo() -> list[str| Path]:
return ["a", "b", Path("/tmp")]
def main() -> None:
cmd_line = foo()
file = cmd_line[0]
args = cmd_line[1:]
os.execvp(
file=file,
args=args,
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment