From 38e2addbb6b1b617a3918dace4df7e6d1e939cea Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Fri, 14 Oct 2022 17:23:38 -0700 Subject: [PATCH] simplify type annotation for MetadataType --- jc/cli.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/jc/cli.py b/jc/cli.py index cd9c6f82..4483fefd 100644 --- a/jc/cli.py +++ b/jc/cli.py @@ -25,6 +25,11 @@ from .shell_completions import bash_completion, zsh_completion from . import tracebackplus from .exceptions import LibraryNotInstalled, ParseError +MetadataType = Dict[ + str, + Optional[Union[str, int, float, List[str], datetime]] +] + # make pygments import optional try: import pygments @@ -598,7 +603,7 @@ class JcCli(): even if there are no results. """ if self.run_timestamp: - meta_obj: Dict[str, Optional[Union[str, int, float, List[str], datetime]]] = { + meta_obj: MetadataType = { 'parser': self.parser_name, 'timestamp': self.run_timestamp.timestamp() }