Skip to content

Commit

Permalink
Clean converter.py
Browse files Browse the repository at this point in the history
  • Loading branch information
katsumiok committed Feb 17, 2024
1 parent 3401c6e commit 569a75b
Showing 1 changed file with 0 additions and 15 deletions.
15 changes: 0 additions & 15 deletions pyaskit/types/converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
try:
from typing import (
Literal,
TypedDict,
_TypedDictMeta,
get_origin,
get_args,
Expand All @@ -12,27 +11,15 @@
except ImportError:
from typing_extensions import (
Literal,
TypedDict,
_TypedDictMeta,
get_origin,
get_args,
get_type_hints,
)

# from typing import Literal
import pyaskit.types as t


def is_typed_dict(type_hint) -> bool:
"""
Check whether the provided type hint is a TypedDict.
Args:
- type_hint: The type hint to check.
Returns:
- bool: True if the type_hint is a TypedDict, False otherwise.
"""
if isinstance(type_hint, _TypedDictMeta):
return True
return False
Expand All @@ -49,8 +36,6 @@ def convert_type(x):
return t.str
origin = get_origin(x)
args = get_args(x)
# origin = getattr(x, "__origin__", None)
# args = getattr(x, "__args__", ())
if origin is list:
return t.list(convert_type(args[0]))
elif origin is tuple:
Expand Down

0 comments on commit 569a75b

Please sign in to comment.