python-iterutils 0.0.4.4__tar.gz → 0.0.4.5__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {python_iterutils-0.0.4.4 → python_iterutils-0.0.4.5}/PKG-INFO +1 -1
- {python_iterutils-0.0.4.4 → python_iterutils-0.0.4.5}/iterutils/__init__.py +10 -5
- {python_iterutils-0.0.4.4 → python_iterutils-0.0.4.5}/pyproject.toml +1 -1
- {python_iterutils-0.0.4.4 → python_iterutils-0.0.4.5}/LICENSE +0 -0
- {python_iterutils-0.0.4.4 → python_iterutils-0.0.4.5}/iterutils/py.typed +0 -0
- {python_iterutils-0.0.4.4 → python_iterutils-0.0.4.5}/readme.md +0 -0
|
@@ -168,7 +168,7 @@ def cut_iter(
|
|
|
168
168
|
|
|
169
169
|
|
|
170
170
|
def run_gen_step(
|
|
171
|
-
gen_step: Generator[
|
|
171
|
+
gen_step: Generator[Any, Any, T] | Callable[[], Generator[Any, Any, T]],
|
|
172
172
|
*,
|
|
173
173
|
async_: bool = False,
|
|
174
174
|
threaded: bool = False,
|
|
@@ -191,9 +191,14 @@ def run_gen_step(
|
|
|
191
191
|
func = send(None)
|
|
192
192
|
while True:
|
|
193
193
|
try:
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
194
|
+
if isawaitable(func):
|
|
195
|
+
ret = await func
|
|
196
|
+
elif callable(func):
|
|
197
|
+
ret = func()
|
|
198
|
+
if isawaitable(ret):
|
|
199
|
+
ret = await ret
|
|
200
|
+
else:
|
|
201
|
+
ret = func
|
|
197
202
|
except BaseException as e:
|
|
198
203
|
if threaded:
|
|
199
204
|
func = await to_thread(throw, e)
|
|
@@ -233,7 +238,7 @@ def run_gen_step(
|
|
|
233
238
|
func = send(None)
|
|
234
239
|
while True:
|
|
235
240
|
try:
|
|
236
|
-
ret = func()
|
|
241
|
+
ret = func() if callable(func) else ret
|
|
237
242
|
except BaseException as e:
|
|
238
243
|
func = throw(e)
|
|
239
244
|
else:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|