Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Use string literal types of generic builtins for type checking #1942

Merged
merged 3 commits into from
Aug 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .coveragerc

This file was deleted.

8 changes: 3 additions & 5 deletions src/pyhf/typing.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import os
import sys
from typing import TYPE_CHECKING, MutableSequence, Sequence, Union
from typing import MutableSequence, Sequence, Union

if sys.version_info >= (3, 8):
from typing import Literal, TypedDict
Expand All @@ -27,10 +27,8 @@
"Workspace",
)

if TYPE_CHECKING:
PathOrStr = Union[str, os.PathLike[str]]
else:
PathOrStr = Union[str, "os.PathLike[str]"]
# TODO: Switch to os.PathLike[str] once Python 3.8 support dropped
PathOrStr = Union[str, "os.PathLike[str]"]


class ParameterBase(TypedDict, total=False):
Expand Down