Julia: Documentation guarantee that `keys(Dict)` and `values(Dict)` iterate the elements of a `Dict` in the same order

Created on 17 Aug 2016  路  6Comments  路  Source: JuliaLang/julia

Looking at dict.jl I see that keys(Dict) and values(Dict) simply iterate the Dict, returning the key or the value, respectively. Therefore they return the elements in the same order (see http://stackoverflow.com/questions/39002073/values-and-keys-guaranteed-to-be-in-the-same-order). It would be nice if this were guaranteed in the documentation (that is, that it doesn't change in the future).

doc help wanted needs tests

All 6 comments

If we document it, we should also test it, which I think isn't done at present.

can i solve this issue. i am new to contributing, i dont know the process of assigning the issue.

We don't generally assign issues to somebody. Just mentioning here that you're working on it is fine.

i am newbie to contributing, so just to confirm my tasks to solve this issue.

1) Update docstring of Dict([itr]) with this string -> keys(Dict) and values(Dict) iterate the elements of a Dict in the same order.
2) add jldoctest to test that keys(Dict) and values(Dict) return elements in same order.

i am newbie to contributing, so just to confirm my tasks to solve this issue.

Update docstring of Dict([itr]) with this string -> keys(Dict) and values(Dict) iterate the elements of a Dict in the same order.

Rather to the docstrings for keys and values.

add jldoctest to test that keys(Dict) and values(Dict) return elements in same order.

You can add a doctest if it makes sense to present this in the docstring. If it's too long, add it to a test in test/dict.jl instead.

i have created the pull request for this issue

Was this page helpful?
0 / 5 - 0 ratings

Related issues

iamed2 picture iamed2  路  3Comments

tkoolen picture tkoolen  路  3Comments

dpsanders picture dpsanders  路  3Comments

yurivish picture yurivish  路  3Comments

i-apellaniz picture i-apellaniz  路  3Comments