util: add types module defining PathLike type
Add a simple new module meant to define types that are commonly used throughout the code-base. For starters, define `PathLike` meant to represent file system paths, i.e. strings, bytes, or anything that provides the `os.PathLike` protocol, i.e. that can be used with `os.fspath`.
This commit is contained in:
parent
21a60324bc
commit
2fd83ac90d
1 changed files with 11 additions and 0 deletions
11
osbuild/util/types.py
Normal file
11
osbuild/util/types.py
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
#
|
||||
# Define some useful typing abbreviations
|
||||
#
|
||||
|
||||
import os
|
||||
|
||||
from typing import Union
|
||||
|
||||
|
||||
#: Represents a file system path. See also `os.fspath`.
|
||||
PathLike = Union[str, bytes, os.PathLike]
|
||||
Loading…
Add table
Add a link
Reference in a new issue