-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
peek() returns a tuple instead of a key #12319
Comments
The return type was just changed from Tuple to Pair in #12327, so I assume this should be considered a documentation issue. |
A pair is still essentially two values, however -- which is the conflict I am referencing. Should peek() return a single value in the same way as dequeue!()? |
When @dcjones created it in 39b5c3d#diff-10b4d49367d18d7903690d5b40f848fcR184, it only returned a key. @timholy changed it (back?) to a pair in #8011, and that seems to be the intent. I also believe he uses this code, so he should probably chime in. (I don't think I ever touched this code.) |
Small correction: it always returned the |
This is really more about whether As it stands right now,
We can work around this with peek.
The intent of the second example is obscured by the use of Should Another possibility is to give |
I think this can be closed since |
Arch Linux Julia package:
Julia Version 0.3.10
Commit c8ceeef (2015-06-24 13:54 UTC)
(I believe this issue is also present in the latest commit and docs.)
Instead of returning only the key,
peek()
returns a tuple consisting of a(k,v)
tuple.Is the documentation wrong or is the behavior wrong?
The text was updated successfully, but these errors were encountered: