JuliaLang/julia

make KeyIterator and ValueIterator more array-like

开放

#10,092 创建于 2015年2月5日

 (9 条评论) (3 个反应) (0 位负责人)Julia (5,773 个派生)batch import
collectionshelp wanted

仓库指标

星标
 (48,709 个星标)
PR 合并指标
 (平均合并 20天 6小时) (30 天内合并 157 个 PR)

描述

When have d = Dict(:foo => 12.34, "bar" => 567) and you write keys(d) you get a Base.KeyIterator object, which is fast and cheap to construct from the dictionary d. You can write collect(keys(d)) to get an array of keys, but you have to do this unfortunately often. It would be a good self-contained project to add more array-like behaviors to KeyIterator and the corresponding ValueIterator types so that things like keys(d)[1] and values(d)[end] work as expected.

贡献者指南