python-iterutils 0.1.3__tar.gz → 0.1.3.1__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.1.3 → python_iterutils-0.1.3.1}/PKG-INFO +1 -1
- {python_iterutils-0.1.3 → python_iterutils-0.1.3.1}/iterutils/__init__.py +13 -3
- {python_iterutils-0.1.3 → python_iterutils-0.1.3.1}/pyproject.toml +1 -1
- {python_iterutils-0.1.3 → python_iterutils-0.1.3.1}/LICENSE +0 -0
- {python_iterutils-0.1.3 → python_iterutils-0.1.3.1}/iterutils/py.typed +0 -0
- {python_iterutils-0.1.3 → python_iterutils-0.1.3.1}/readme.md +0 -0
|
@@ -181,23 +181,33 @@ async def async_flatten(
|
|
|
181
181
|
|
|
182
182
|
|
|
183
183
|
def map(
|
|
184
|
-
function: Callable,
|
|
184
|
+
function: None | Callable,
|
|
185
185
|
iterable: Iterable | AsyncIterable,
|
|
186
186
|
/,
|
|
187
187
|
*iterables: Iterable | AsyncIterable,
|
|
188
|
-
):
|
|
188
|
+
):
|
|
189
189
|
if (
|
|
190
190
|
iscoroutinefunction(function) or
|
|
191
191
|
isinstance(iterable, AsyncIterable) or
|
|
192
192
|
any(isinstance(i, AsyncIterable) for i in iterables)
|
|
193
193
|
):
|
|
194
|
+
if function is None:
|
|
195
|
+
if iterables:
|
|
196
|
+
return async_zip(iterable, *iterables)
|
|
197
|
+
else:
|
|
198
|
+
return iterable
|
|
194
199
|
return async_map(function, iterable, *iterables)
|
|
200
|
+
if function is None:
|
|
201
|
+
if iterables:
|
|
202
|
+
return zip(iterable, *iterables)
|
|
203
|
+
else:
|
|
204
|
+
return iterable
|
|
195
205
|
from builtins import map
|
|
196
206
|
return map(function, iterable, *iterables)
|
|
197
207
|
|
|
198
208
|
|
|
199
209
|
def filter(
|
|
200
|
-
function: Callable,
|
|
210
|
+
function: None | Callable,
|
|
201
211
|
iterable: Iterable | AsyncIterable,
|
|
202
212
|
/,
|
|
203
213
|
):
|
|
File without changes
|
|
File without changes
|
|
File without changes
|