Skip to content
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

RFC: add a dirty flag to Dict #9595

Merged
merged 2 commits into from
May 29, 2015
Merged

RFC: add a dirty flag to Dict #9595

merged 2 commits into from
May 29, 2015

Conversation

JeffBezanson
Copy link
Member

This implements my suggestion in #9573. Could also be used to detect modification during iteration.

@JeffBezanson JeffBezanson changed the title add a dirty flag to Dict RFC: add a dirty flag to Dict Jan 4, 2015
@garrison
Copy link
Member

Here's a (minimal) test case to add with this:

# Issue #7944
let d = Dict{Int,Int}()
    get!(d, 0) do
        d[0] = 1
    end
    @test length(d) == 1
end

makes `get!` work with default functions that modify the dict. fixes #9573
@JeffBezanson
Copy link
Member Author

Ok, rebased & test added. Will merge when CI finishes.

@garrison
Copy link
Member

Awesome, thanks!

JeffBezanson added a commit that referenced this pull request May 29, 2015
@JeffBezanson JeffBezanson merged commit 1698bbe into master May 29, 2015
@JeffBezanson JeffBezanson deleted the jb/dictdirtyflag branch May 29, 2015 17:19
nalimilan added a commit that referenced this pull request Apr 20, 2024
This is guaranteed since #9595 but not documented.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants