Skip to content

Commit

Permalink
Remove TypeAlias import workaround
Browse files Browse the repository at this point in the history
pyright now seems to understand the `_compat` import properly.
  • Loading branch information
Viicos committed Oct 1, 2024
1 parent 534830e commit e1c6e5c
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 7 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ src = ["src"]
target-version = "py38"

[tool.ruff.lint]
typing-modules = ["_compat"]
typing-modules = ["jsonlogic._compat"]
preview = true
explicit-preview-rules = true
select = [
Expand Down
3 changes: 0 additions & 3 deletions src/jsonlogic/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@
from .typing import JSON, JSONLogicPrimitive, JSONObject, OperatorArgument

if TYPE_CHECKING:
# This is a hack to make Pylance think `TypeAlias` comes from `typing`
from typing import TypeAlias

from .evaluation import EvaluationContext
from .registry import OperatorRegistry
from .typechecking import TypecheckContext
Expand Down
3 changes: 0 additions & 3 deletions src/jsonlogic/typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@
from ._compat import TypeAlias

if TYPE_CHECKING:
# This is a hack to make Pylance think `TypeAlias` comes from `typing`
from typing import TypeAlias

from jsonlogic.core import Operator

JSONPrimitive: TypeAlias = "str | int | float | bool | None"
Expand Down

0 comments on commit e1c6e5c

Please sign in to comment.