Skip to content

Commit 0f7cf12

Browse files
committed
fix doc
1 parent 425879c commit 0f7cf12

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1007,8 +1007,8 @@ because ``(g, x, y)`` is just a tuple of ``g``, ``x`` and ``y``. This is by desi
10071007
- `partition` from `itertools` [recipes](https://docs.python.org/3/library/itertools.html#itertools-recipes).
10081008
- `rev` is a convenience function that tries `reversed`, and if the input was not a sequence, converts it to a tuple and reverses that. The return value is a `reversed` object.
10091009
- `scons`: prepend one element to the start of an iterable, return new iterable. ``scons(x, iterable)`` is lispy shorthand for ``itertools.chain((x,), iterable)``, allowing to omit the one-item tuple wrapper.
1010-
- `inn`: contains-check (``x in iterable``) with automatic termination for monotonic infinite iterables. *Added in v0.13.1.*
1011-
- Only applicable to monotonic inputs. Increasing/decreasing is auto-detected from the first non-zero diff, but the function may fail to terminate if the input is actually not monotonic.
1010+
- `inn`: contains-check (``x in iterable``) with automatic termination for monotonic divergent infinite iterables. *Added in v0.13.1.*
1011+
- Only applicable to monotonic divergent inputs (such as ``primes``). Increasing/decreasing is auto-detected from the first non-zero diff, but the function may fail to terminate if the input is actually not monotonic, or has an upper/lower bound.
10121012
- `iindex`: like ``list.index``, but for a general iterable. Consumes the iterable, so only makes sense for memoized inputs. *Added in v0.13.1.*
10131013
- `prod`: like the builtin `sum`, but compute the product. Oddly missing from the standard library. *Added in v0.13.1.*
10141014

unpythonic/it.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -539,9 +539,10 @@ def inn(x, iterable):
539539
540540
``iterable`` may be infinite.
541541
542-
We assume ``iterable`` is **monotonic**. In other words, we require
543-
``it[k+1] >= it[k]`` or ``it[k+1] <= it[k]``. If ``iterable`` is
544-
not monotonic, this function may fail to terminate.
542+
We assume ``iterable`` is **monotonic** and **divergent**. In other words,
543+
we require ``it[k+1] >= it[k]`` (or ``it[k+1] <= it[k]``), and that the
544+
sequence has no upper (or respectively lower) bound. If ``iterable``
545+
does not fulfill these conditions, this function may fail to terminate.
545546
546547
This is fully duck-typed; we only require that ``x`` and the elements of
547548
``iterable`` are comparable by ``==``, ``<=`` and ``>=``.

0 commit comments

Comments
 (0)