Skip to content

Commit

Permalink
Python 3.7/3.8 compatible type check
Browse files Browse the repository at this point in the history
  • Loading branch information
dbieber committed Sep 22, 2024
1 parent b32d1f5 commit 721143e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions fire/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
command line arguments to client code.
"""

from typing import Any
from typing import Any, Dict
import inspect

FIRE_METADATA = 'FIRE_METADATA'
Expand Down Expand Up @@ -81,7 +81,7 @@ def _SetMetadata(fn, attribute, value):
setattr(fn, FIRE_METADATA, metadata)


def GetMetadata(fn) -> dict[str, Any]:
def GetMetadata(fn) -> Dict[str, Any]:
"""Gets metadata attached to the function `fn` as an attribute.
Args:
Expand All @@ -104,7 +104,7 @@ def GetMetadata(fn) -> dict[str, Any]:
return default


def GetParseFns(fn) -> dict[str, Any]:
def GetParseFns(fn) -> Dict[str, Any]:
metadata = GetMetadata(fn)
default = {'default': None, 'positional': [], 'named': {}}
return metadata.get(FIRE_PARSE_FNS, default)

0 comments on commit 721143e

Please sign in to comment.