Skip to content

Commit

Permalink
use builtin ast module as is
Browse files Browse the repository at this point in the history
  • Loading branch information
m.kindritskiy committed Sep 15, 2024
1 parent 2c9437f commit 1a4bebf
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 14 deletions.
13 changes: 0 additions & 13 deletions hiku/compat.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,8 @@
import sys
import ast as _ast
from typing import Any

PY310: bool = sys.version_info >= (3, 10)


# TODO: maybe we can remove this custom class ?
class _AST:
def __getattr__(self, name: str) -> Any:
return getattr(_ast, name)

arguments = _ast.arguments


ast = _AST()

if sys.version_info >= (3, 10):
from typing import Concatenate, ParamSpec, TypeAlias
else:
Expand All @@ -23,7 +11,6 @@ def __getattr__(self, name: str) -> Any:

__all__ = [
"PY310",
"ast",
"Concatenate",
"ParamSpec",
"TypeAlias",
Expand Down
2 changes: 1 addition & 1 deletion hiku/expr/compiler.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import ast as py
from contextlib import contextmanager
from collections import Counter

from ..types import CallableMeta
from ..compat import ast as py

from .core import THIS
from .nodes import Symbol, Keyword
Expand Down

0 comments on commit 1a4bebf

Please sign in to comment.