Skip to content

Commit

Permalink
chore: remove unused function my_get_type_hints
Browse files Browse the repository at this point in the history
  • Loading branch information
eginhard committed Oct 17, 2024
1 parent 8410ee3 commit 777e7a7
Showing 1 changed file with 1 addition and 18 deletions.
19 changes: 1 addition & 18 deletions coqpit/coqpit.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from dataclasses import Field, asdict, dataclass, fields, is_dataclass, replace
from pathlib import Path
from pprint import pprint
from typing import Any, Dict, Generic, List, Optional, Type, TypeVar, Union, get_type_hints
from typing import Any, Dict, Generic, List, Optional, Type, TypeVar, Union

T = TypeVar("T")
MISSING: Any = "???"
Expand Down Expand Up @@ -135,23 +135,6 @@ def _is_optional_field(field) -> bool:
return type(None) in field.type.__args__


def my_get_type_hints(
cls,
):
"""Custom `get_type_hints` dealing with https://github.com/python/typing/issues/737
Returns:
[dataclass]: dataclass to get the type hints of its fields.
"""
r_dict = {}
for base in cls.__class__.__bases__:
if base == object:
break
r_dict.update(my_get_type_hints(base))
r_dict.update(get_type_hints(cls))
return r_dict


def _serialize(x):
"""Pick the right serialization for the datatype of the given input.
Expand Down

0 comments on commit 777e7a7

Please sign in to comment.