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
I was expecting to be able to iterate through these grouped dictionaries, but I'm noticing they do not seem to follow the AbstractDict interface. Is this an intentional design decision? If so, is there a benefit to this counterintuitive behavior?
In your example we can do something like length.(group(iseven, 1:5)). You can convert the result to a Dict straightforwardly if that works better for you.
With Dict we can’t use things like map and broadcast. Dictionaries.jl is an attempt to bring the niceties of working with arrays in Julia to dictionaries and sets, too.
@andyferris Ah yes, this definitely makes sense! Messing around with the package more I can definitely see the power in that decision.
I see now there's a note in the README, but it's pretty easy to overlook tacked at the end of the quick start, and I wouldn't have thought much of it had I noticed it. Might it be worth putting it somewhere more prominent & noting the consequences/utility of the decision? It does create a significant behavior divergence from the core libraries, and I expect I'm not the first naive user of the library thrown off by this.
If you're interested, I'd be happy to throw up a PR to that effect when I find some time.
Yes the documentation could definitely be improved. In fact, a lot of the usage documentation lives elsewhere like in the TypedTables docs. Contributions are welcome :)
I was expecting to be able to iterate through these grouped dictionaries, but I'm noticing they do not seem to follow the AbstractDict interface. Is this an intentional design decision? If so, is there a benefit to this counterintuitive behavior?
The text was updated successfully, but these errors were encountered: