You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be really nice to be able to iterate all the funcs in compose, without having to combine the first and funcs properties. It would let you immediately use Compose objects as iterables in the itertoolz functions.
in order to map over those functions and re-compose:
@currydefinterleave_map(func, items):
# [1,2,3] -> [func(1), 1, func(2), 2, func(3), 3]returninterleave([map(func, items), items])
# define a debug function that interleaves logging funcs inbetween each func in an existing compositiondebug=compose_left(get_funcs, interleave_map(passthru_log), star(compose_left))
if the Compose class were iterable, I could completely eliminate the get_funcs function, and comfortably feed the compose object directly into interleave:
It would be really nice to be able to iterate all the funcs in compose, without having to combine the
first
andfuncs
properties. It would let you immediately use Compose objects as iterables in the itertoolz functions.For an example, consider the simple logging strategy outlined in my gist here:
https://gist.github.com/ZeroBomb/8ac470b1d4b02c11f2873c5d4e0512a1
As written, I need to define this somewhat extraneous function
in order to map over those functions and re-compose:
if the Compose class were iterable, I could completely eliminate the get_funcs function, and comfortably feed the compose object directly into interleave:
The text was updated successfully, but these errors were encountered: