improve type annotations
This commit is contained in:
parent
fdae5aa6de
commit
c907c006db
@ -11,13 +11,13 @@ import tempfile
|
|||||||
import subprocess
|
import subprocess
|
||||||
import shlex
|
import shlex
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import Callable, TypeVar
|
from typing import TypeVar
|
||||||
from collections.abc import Iterator, Sequence
|
from collections.abc import Iterator, Callable
|
||||||
|
|
||||||
T = TypeVar('T')
|
R = TypeVar('R')
|
||||||
|
|
||||||
|
|
||||||
def star(f: Callable[..., T]) -> Callable[[Sequence], T]:
|
def star(f: Callable[..., R]) -> Callable[[tuple], R]:
|
||||||
""" see https://stackoverflow.com/q/21892989 """
|
""" see https://stackoverflow.com/q/21892989 """
|
||||||
return lambda args: f(*args)
|
return lambda args: f(*args)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user