Skip to content

Commit e18cee4

Browse files
aquacash5arbipher
authored andcommitted
Add Iterators as acceptable arguments to functions (Z3Prover#7620)
1 parent 07900f7 commit e18cee4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/api/python/z3/z3.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
import math
5555
import copy
5656
if sys.version_info.major >= 3:
57-
from typing import Iterable
57+
from typing import Iterable, Iterator
5858

5959
from collections.abc import Callable
6060
from typing import (
@@ -155,6 +155,8 @@ def _get_args(args):
155155
return args[0]
156156
elif len(args) == 1 and (isinstance(args[0], set) or isinstance(args[0], AstVector)):
157157
return [arg for arg in args[0]]
158+
elif len(args) == 1 and isinstance(args[0], Iterator):
159+
return list(args[0])
158160
else:
159161
return args
160162
except TypeError: # len is not necessarily defined when args is not a sequence (use reflection?)

0 commit comments

Comments
 (0)