211102-0111 python defining own types for typing
After writing whatever: str or Path
or whataver: Union[str, Path]
for the N-th time I googled how to do this better. Well, 1
from typing import Union
from pathlib import Path
pathlike = Union[str, Path]
whatever: pathlike = some_function()
def f_paths(path_one: pathlike):
Nel mezzo del deserto posso dire tutto quello che voglio.
comments powered by Disqus