Skip to content

Commit

Permalink
Merge pull request #17978 from JuliaLang/teh/enumerate_docs
Browse files Browse the repository at this point in the history
Expand docs on enumerate's relationship with indexing
  • Loading branch information
timholy authored Aug 15, 2016
2 parents 5e58247 + 2311507 commit f73e6e1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 6 additions & 4 deletions base/iterator.jl
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,12 @@ end
"""
enumerate(iter)
An iterator that yields `(i, x)` where `i` is an index starting at 1, and
`x` is the `i`th value from the given iterator. It's useful when you need
not only the values `x` over which you are iterating, but also the index `i`
of the iterations.
An iterator that yields `(i, x)` where `i` is a counter starting at 1,
and `x` is the `i`th value from the given iterator. It's useful when
you need not only the values `x` over which you are iterating, but
also the number of iterations so far. Note that `i` may not be valid
for indexing `iter`; it's also possible that `x != iter[i]`, if `iter`
has indices that do not start at 1.
```jldoctest
julia> a = ["a", "b", "c"];
Expand Down
2 changes: 1 addition & 1 deletion doc/stdlib/collections.rst
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ type.

.. Docstring generated from Julia source
An iterator that yields ``(i, x)`` where ``i`` is an index starting at 1, and ``x`` is the ``i``\ th value from the given iterator. It's useful when you need not only the values ``x`` over which you are iterating, but also the index ``i`` of the iterations.
An iterator that yields ``(i, x)`` where ``i`` is a counter starting at 1, and ``x`` is the ``i``\ th value from the given iterator. It's useful when you need not only the values ``x`` over which you are iterating, but also the number of iterations so far. Note that ``i`` may not be valid for indexing ``iter``\ ; it's also possible that ``x != iter[i]``\ , if ``iter`` has indices that do not start at 1.

.. doctest::

Expand Down

4 comments on commit f73e6e1

@nanosoldier
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Executing the daily benchmark build, I will reply here when finished:

@nanosoldier runbenchmarks(ALL, isdaily = true)

@nanosoldier
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your benchmark job has completed - possible performance regressions were detected. A full report can be found here. cc @jrevels

@Sacha0
Copy link
Member

@Sacha0 Sacha0 commented on f73e6e1 Aug 16, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Many serious regressions?

@tkelman
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looking like it was due to #18017

Please sign in to comment.