-
Notifications
You must be signed in to change notification settings - Fork 265
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
eager map & filter? #483
Comments
|
Good questions @bijoythomas and thanks for the quick, informative reply @groutr. I always like to hear experiences of new users. Since the questions have been answered, can we close this issue? Btw, we have considered having a non-lazy namespace so one could do things like |
Agree. I had these above questions myself. Good to know. One thing I'd say is that since map and filter's value is not differentiated by this library anymore, then the docs should not show them being imported from the itertoolz library or any library. Seeing |
@startakovsky there is a difference between the built-in @eriknw I would suggest keeping everything lazy and just adding a consumer function that enforces eager evaluation. For instance, to eagerly evaluate a map object, you can just build a This way, there would be no need for an eager namespace. Everything would be lazy by default, and if you want eager evaluation you either build a |
@ruancomelli note that |
@eriknw I think the answer to "Both" might also make sense as a user/developer improvement, but on the other hand by only having one, that's more Pythonic ("there should only be one way to do it"), it kinda teaches the outer-name-scope-should-be-more-general pattern by example, and there's no breaking change in starting with just one and switching to both later if it proves to be a usability problem. |
Hello, I'm new to toolz and am trying out the functions in the curried namespace. The code below
returns a map object instead of a list (which I was expecting). However,
return a dict with list values as expected instead of a dict with sub-iterators (like
itertools.groupby
)Is there a reason for keeping the curried
map
&filter
lazy like the native Python3 functions?The text was updated successfully, but these errors were encountered: