From 1f6b13bba57baca97c7038ee7994c206dd1c85d3 Mon Sep 17 00:00:00 2001 From: Andrew Zhu Date: Thu, 8 Jul 2021 11:29:02 -0700 Subject: [PATCH] fix: no typing.Literal in py<3.8 --- d20/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/d20/utils.py b/d20/utils.py index 9774b85..a5cd3d8 100644 --- a/d20/utils.py +++ b/d20/utils.py @@ -1,5 +1,5 @@ import copy -from typing import Callable, Literal, Optional, TypeVar +from typing import Callable, Optional, TypeVar import d20 # this import is here for the doctests from d20 import diceast, expression @@ -65,7 +65,7 @@ def ast_adv_copy(ast: ASTNode, advtype: AdvType) -> ASTNode: return root -def simplify_expr_annotations(expr: ExpressionNode, ambig_inherit: Optional[Literal['left', 'right']] = None): +def simplify_expr_annotations(expr: ExpressionNode, ambig_inherit: Optional[str] = None): """ Transforms an expression in place by simplifying the annotations using a bubble-up method.