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

Documentation guarantee that keys(Dict) and values(Dict) iterate the elements of a Dict in the same order #18090

Closed
cossio opened this issue Aug 17, 2016 · 6 comments
Labels
docs This change adds or pertains to documentation help wanted Indicates that a maintainer wants help on an issue or pull request needs tests Unit tests are required for this change
Milestone

Comments

@cossio
Copy link
Contributor

cossio commented Aug 17, 2016

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).

@cossio cossio changed the title Guarantee keys(Dict) and values(Dict) iterate a the elements of a Dict in the same order Documentation guarantee that keys(Dict) and values(Dict) iterate the elements of a Dict in the same order Aug 17, 2016
@kshyatt kshyatt added the docs This change adds or pertains to documentation label Aug 17, 2016
@martinholters
Copy link
Member

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

@tkelman tkelman added the needs tests Unit tests are required for this change label Aug 23, 2016
@StefanKarpinski StefanKarpinski modified the milestones: 0.6.0, 0.5.x Aug 23, 2016
@StefanKarpinski StefanKarpinski added help wanted Indicates that a maintainer wants help on an issue or pull request and removed help wanted Indicates that a maintainer wants help on an issue or pull request labels Oct 27, 2016
@prasad-marne
Copy link
Contributor

prasad-marne commented Jan 17, 2017

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

@nalimilan
Copy link
Member

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

@prasad-marne
Copy link
Contributor

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.

@nalimilan
Copy link
Member

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.

prasad-marne pushed a commit to prasad-marne/julia that referenced this issue Jan 24, 2017
@prasad-marne
Copy link
Contributor

i have created the pull request for this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs This change adds or pertains to documentation help wanted Indicates that a maintainer wants help on an issue or pull request needs tests Unit tests are required for this change
Projects
None yet
Development

No branches or pull requests

7 participants