Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
KotlinIsland committed Aug 29, 2024
1 parent 3055bb2 commit f77242c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/basedtyping/transformer.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,9 @@ def visit_Subscript(self, node: ast.Subscript) -> ast.AST:
if isinstance(slice_, ast.Tuple):
slice_.elts[0] = self.visit(slice_.elts[0])
else:
node.slice = self.visit(slice_)
temp = self.visit(slice_)
assert isinstance(temp, ast.expr)
node.slice = temp
return node
with self.implicit_tuple():
result = self.generic_visit(node)
Expand Down Expand Up @@ -220,6 +222,7 @@ def crifigy_type(
*,
string_literals: bool,
) -> object:
tree: ast.AST
try:
tree = ast.parse(value, mode="eval")
except SyntaxError:
Expand Down
2 changes: 1 addition & 1 deletion tests/test_is_subform.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ def test_old_union():
assert issubform(Union[int, str], Union[str, int])
if sys.version_info >= (3, 10):
assert issubform(
Union[int, str], # type: ignore[arg-type]
Union[int, str],
int | str, # type: ignore[unused-ignore, arg-type]
)

0 comments on commit f77242c

Please sign in to comment.