-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
keys(::Generator) pass through #34678
Conversation
@fredrikekre
|
As a test maybe more illustrative:
I propose to put that into |
Triage finds it a little weird but approves since it makes find work and doesn't seem harmful. Would be good to add @KlausC's test and a NEWS entry, however. A use case would also be good. |
Let keys pass through to allow lightweigth/lazy find* and arg* functions
@mbauman sure, got interrupted by something else after rebasing such an old branch for the first time 😇 Edit: for the usecase: julia> findmax(map(x->x^2, 20:30))
(900, 11)
julia> findmax(x^2 for x in 20:30)
ERROR: MethodError: no method matching keys(::Base.Generator{UnitRange{Int64},var"#7#8"}) After this change, the latter produces the same result as the eager map variant: julia> findmax(x^2 for x in 20:30)
(900, 11) By that it allows to findmax without allocating the whole intermediate map output and thus becomes lazy aswell. |
Co-authored-by: Matt Bauman <mbauman@gmail.com>
Kind of fixes #23680 Instead of |
@thofma once this lands, you can just use |
@mbauman well since I guess 1.5 is already pinned now (branched away from master), but to not to add it to the wrong news file, this'll go into 1.6, won't it? (so I can add a news entry straight to the 1.6 news file) I'd put it into the "standard library changes" section. |
I think isequal(collect(values(A)), [A[k] for k in keys(A)]) So, I'm against this patch unless |
bump for 1.6 👀 |
@fredrikekre would you remove the "needs test" label please. (Since there already is one). And can you add it to a 1.6 milestone? (so that it won't go unnoticed upon freezing, especially since triage already accepted the standalone and #37648 holds the |
Rerunning ci, then good to merge in my view. |
@StefanKarpinski me closing and re-opening doesn't seem to have trigered CI. Can you make it re-run? |
@oscardssmith To me it seems like buildbot was triggered and currently is only missing tester_macos64 and tester_win32. analyzegc_linux64 and package_freebsd64 failed, the rest completed successfully. |
oh yeah. Sorry for the noise. It might be worth rebasing this onto master so we can get a fully green CI. |
This looks like it still has a triage label, was this approved? Typically, the triage label would be removed before we allow a PR to be merged. |
Triage approved back in March. I think it was re-added to consider back-porting once merged, but I'm not sure. |
To be sure, it would be best to hold off then until triage-reapproves and once the requested review is approved. |
Triage is ok with this again. I came around since it basically seems consistent with |
Thank you for the contribution! Sorry this took so long. In the future, also feel free to bump PRs every once in a while, because otherwise things sometimes get forgotten. |
Feature already merged at JuliaLang#34678
* keys(::Generator) pass-through Let keys pass through to allow lightweigth/lazy find* and arg* functions * Update test/functional.jl Co-authored-by: Matt Bauman <mbauman@gmail.com> Co-authored-by: Matt Bauman <mbauman@gmail.com> Co-authored-by: Simeon Schaub <simeondavidschaub99@gmail.com>
Let keys pass through to allow lightweigth/lazy find* and arg* functions
Fixes #34674