Skip to content

Commit

Permalink
MAINT: put TypeVar definitions under TYPE_CHECKING
Browse files Browse the repository at this point in the history
  • Loading branch information
redeboer committed Dec 21, 2023
1 parent 2ddb323 commit 2f7532d
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions src/ampform/sympy/_decorator.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,23 @@
from typing import Protocol, TypedDict

if sys.version_info < (3, 11):
from typing_extensions import ParamSpec, Unpack, dataclass_transform
from typing_extensions import dataclass_transform
else:
from typing import ParamSpec, Unpack, dataclass_transform
from typing import dataclass_transform

Check warning on line 23 in src/ampform/sympy/_decorator.py

View check run for this annotation

Codecov / codecov/patch

src/ampform/sympy/_decorator.py#L23

Added line #L23 was not covered by tests

if TYPE_CHECKING:
from sympy.printing.latex import LatexPrinter

if sys.version_info < (3, 11):
from typing_extensions import ParamSpec, Unpack

Check warning on line 29 in src/ampform/sympy/_decorator.py

View check run for this annotation

Codecov / codecov/patch

src/ampform/sympy/_decorator.py#L29

Added line #L29 was not covered by tests
else:
from typing import ParamSpec, Unpack

Check warning on line 31 in src/ampform/sympy/_decorator.py

View check run for this annotation

Codecov / codecov/patch

src/ampform/sympy/_decorator.py#L31

Added line #L31 was not covered by tests

H = TypeVar("H", bound=Hashable)
P = ParamSpec("P")
T = TypeVar("T")

Check warning on line 35 in src/ampform/sympy/_decorator.py

View check run for this annotation

Codecov / codecov/patch

src/ampform/sympy/_decorator.py#L33-L35

Added lines #L33 - L35 were not covered by tests

ExprClass = TypeVar("ExprClass", bound=sp.Expr)
P = ParamSpec("P")
T = TypeVar("T")
H = TypeVar("H", bound=Hashable)


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

0 comments on commit 2f7532d

Please sign in to comment.