Skip to content

Commit

Permalink
use union
Browse files Browse the repository at this point in the history
  • Loading branch information
clarus committed May 21, 2024
1 parent c77fdb8 commit af55185
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import ast
import os
import sys
from typing import Union


def generate_error(kind, node):
Expand Down Expand Up @@ -245,8 +246,8 @@ def generate_function_def_body(indent, node):
def generate_if_then_else(
indent,
condition: ast.expr,
success: ast.expr | list[ast.stmt],
error: ast.expr | list[ast.stmt],
success: Union[ast.expr, list[ast.stmt]],
error: Union[ast.expr, list[ast.stmt]],
):
return generate_indent(indent) + "(* if *)\n" + \
generate_indent(indent) + "M.if_then_else (|\n" + \
Expand Down

0 comments on commit af55185

Please sign in to comment.