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.

貢獻者指南