We require python 3.8 so no need to guard typing.Literal

This commit is contained in:
Kovid Goyal
2023-10-15 09:58:19 +05:30
parent baddc966dc
commit 0e11174aa5
2 changed files with 18 additions and 41 deletions

View File

@@ -368,12 +368,8 @@ def generate_class(defn: Definition, loc: str) -> Tuple[str, str]:
output_imports(imports)
a('')
if choices:
a('if typing.TYPE_CHECKING:')
for name, cdefn in choices.items():
a(f' {name} = {cdefn}')
a('else:')
for name in choices:
a(f' {name} = str')
a(f'{name} = {cdefn}')
a('')
a('option_names = ( # {{''{')