Skip to content

Commit b7ecdf6

Browse files
akbakb
authored andcommitted
Add wrap_sync_fold
1 parent c1a746d commit b7ecdf6

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/mario/traversals.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,15 @@ async def sync_apply(
150150
yield x
151151

152152

153+
import functools
154+
def wrap_sync_fold(function):
155+
@functools.wraps(function)
156+
def wrap(items):
157+
yield from [function(items)]
158+
159+
return wrap
160+
161+
153162
async def async_apply(function, data):
154163
return await function(data)
155164

0 commit comments

Comments
 (0)