Skip to content

Commit

Permalink
Make export function preserve types
Browse files Browse the repository at this point in the history
  • Loading branch information
adamnovak committed Dec 14, 2023
1 parent 3f684ea commit 5731f85
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions WDL/_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,12 @@
from types import FrameType
from pythonjsonlogger import jsonlogger

T = TypeVar("T")

__all__: List[str] = []


def export(obj) -> str: # pyre-ignore
def export(obj: T) -> T: # pyre-ignore
__all__.append(obj.__name__)
return obj

Expand Down Expand Up @@ -67,7 +69,6 @@ def strip_leading_whitespace(txt: str) -> Tuple[int, str]:
return (to_strip, "\n".join(lines))


T = TypeVar("T")


@export
Expand Down

0 comments on commit 5731f85

Please sign in to comment.