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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: python-iterutils
3
- Version: 0.1.3
3
+ Version: 0.1.3.1
4
4
  Summary: Python another itertools.
5
5
  Home-page: https://github.com/ChenyangGao/web-mount-packs/tree/main/python-module/python-iterutils
6
6
  License: MIT
@@ -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
  ):
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "python-iterutils"
3
- version = "0.1.3"
3
+ version = "0.1.3.1"
4
4
  description = "Python another itertools."
5
5
  authors = ["ChenyangGao <wosiwujm@gmail.com>"]
6
6
  license = "MIT"