python-iterutils 0.2.5.3__py3-none-any.whl → 0.2.5.4__py3-none-any.whl
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.
- iterutils/__init__.py +23 -14
- {python_iterutils-0.2.5.3.dist-info → python_iterutils-0.2.5.4.dist-info}/METADATA +1 -1
- python_iterutils-0.2.5.4.dist-info/RECORD +7 -0
- python_iterutils-0.2.5.3.dist-info/RECORD +0 -7
- {python_iterutils-0.2.5.3.dist-info → python_iterutils-0.2.5.4.dist-info}/LICENSE +0 -0
- {python_iterutils-0.2.5.3.dist-info → python_iterutils-0.2.5.4.dist-info}/WHEEL +0 -0
iterutils/__init__.py
CHANGED
|
@@ -480,9 +480,12 @@ def zip(
|
|
|
480
480
|
):
|
|
481
481
|
"""
|
|
482
482
|
"""
|
|
483
|
-
if
|
|
484
|
-
|
|
485
|
-
|
|
483
|
+
if (not threaded and
|
|
484
|
+
isinstance(iterable, Iterable) and
|
|
485
|
+
all(isinstance(it, Iterable) for it in iterables)
|
|
486
|
+
):
|
|
487
|
+
return _zip(iterable, *iterables)
|
|
488
|
+
return async_zip(iterable, *iterables, threaded=threaded)
|
|
486
489
|
|
|
487
490
|
|
|
488
491
|
@overload
|
|
@@ -507,9 +510,12 @@ def chain[T](
|
|
|
507
510
|
*iterables: Iterable[T] | AsyncIterable[T],
|
|
508
511
|
threaded: bool = False,
|
|
509
512
|
) -> Iterator[T] | AsyncIterator[T]:
|
|
510
|
-
if threaded
|
|
511
|
-
|
|
512
|
-
|
|
513
|
+
if (not threaded and
|
|
514
|
+
isinstance(iterable, Iterable) and
|
|
515
|
+
all(isinstance(it, Iterable) for it in iterables)
|
|
516
|
+
):
|
|
517
|
+
return _chain(iterable, *iterables) # type: ignore
|
|
518
|
+
return async_chain(iterable, *iterables, threaded=threaded)
|
|
513
519
|
|
|
514
520
|
|
|
515
521
|
@overload
|
|
@@ -589,14 +595,17 @@ def foreach(
|
|
|
589
595
|
):
|
|
590
596
|
"""
|
|
591
597
|
"""
|
|
592
|
-
if
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
598
|
+
if (not threaded and
|
|
599
|
+
isinstance(iterable, Iterable) and
|
|
600
|
+
all(isinstance(it, Iterable) for it in iterables)
|
|
601
|
+
):
|
|
602
|
+
if iterables:
|
|
603
|
+
for args in _zip(iterable, *iterables):
|
|
604
|
+
value(*args)
|
|
605
|
+
else:
|
|
606
|
+
for arg in iterable:
|
|
607
|
+
value(arg)
|
|
608
|
+
return async_foreach(value, iterable, *iterables, threaded=threaded)
|
|
600
609
|
|
|
601
610
|
|
|
602
611
|
async def async_foreach(
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
LICENSE,sha256=o5242_N2TgDsWwFhPn7yr8YJNF7XsJM5NxUMtcT97bc,1100
|
|
2
|
+
iterutils/__init__.py,sha256=RdMUsfkgNEg9_5Lf4YNfCP8oB_PXJSdd_EHxeitP0Bk,33740
|
|
3
|
+
iterutils/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
|
+
python_iterutils-0.2.5.4.dist-info/LICENSE,sha256=o5242_N2TgDsWwFhPn7yr8YJNF7XsJM5NxUMtcT97bc,1100
|
|
5
|
+
python_iterutils-0.2.5.4.dist-info/METADATA,sha256=fpaQOW9phx56FoA1NE19KlnqaJgYBrwhQGxeZHfxazs,1429
|
|
6
|
+
python_iterutils-0.2.5.4.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
|
|
7
|
+
python_iterutils-0.2.5.4.dist-info/RECORD,,
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
LICENSE,sha256=o5242_N2TgDsWwFhPn7yr8YJNF7XsJM5NxUMtcT97bc,1100
|
|
2
|
-
iterutils/__init__.py,sha256=EVELTMkPih-vJsPKQNA21GJz_NlDIDLrZyhOA4muVTQ,33593
|
|
3
|
-
iterutils/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
|
-
python_iterutils-0.2.5.3.dist-info/LICENSE,sha256=o5242_N2TgDsWwFhPn7yr8YJNF7XsJM5NxUMtcT97bc,1100
|
|
5
|
-
python_iterutils-0.2.5.3.dist-info/METADATA,sha256=ZE7kllJMWnKNk0hHV_2i26nhrrphLPccEeaAPhJ1Dyo,1429
|
|
6
|
-
python_iterutils-0.2.5.3.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
|
|
7
|
-
python_iterutils-0.2.5.3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|