Skip to content

Releases: more-itertools/more-itertools

Version 11.0.1

02 Apr 16:17
5ea81c4

Choose a tag to compare

This release restores pairwise, which was mistakenly removed in 11.0.0 instead of being deprecated. It is now marked as deprecated and will be removed in a future major release. Use itertools.pairwise as a replacement.

Version 11.0.0

02 Apr 15:05
5b43c0d

Choose a tag to compare

Potentially breaking changes

  • Python 3.9 support was dropped, since it went EOL on 2025-10-31
  • callback_iter is deprecated. It will be removed in a future major release.
  • iequals no longer returns True when called with ([], [ANY]) (thanks to rhettinger and pochmann3)
  • The pred argument for locate and replace must now be able to
    handle a variable number of arguments. See their docstrings for details. (thanks to veeceey, james-wasson, and pochmann3)
  • unique_everseen now raises TypeError when input elements are not hashable.
    The silent fallback mechanism for unhashable inputs has been removed. (thanks to rhettinger and karlicoss)
  • windowed now raises ValueError when given a window size of 0 (thanks to rhettinger and brevzin)
  • Parameter names for flatten, iter_except, repeatfunc, prepend, transpose,
    and sum_of_squares have been changed. Code that uses these functions will need to be updated if it
    uses keywords for positional arguments. (thanks to rhettinger)

New functions

  • concurrent_tee: similar to tee, but with guaranteed threading
    semantics (thanks to rhettinger)
  • random_derangement: returns a random derangement of elements from an
    iterable (thanks to rhettinger)
  • running_mean: yields the mean of values in an iterable, or in a sliding
    window (thanks to rhettinger)
  • running_statistics: provides statistics for the values in an iterable, or
    in a sliding window (thanks to rhettinger)
  • serialize: wraps a non-concurrent iterator with a lock to enforce
    sequential access (thanks to rhettinger)
  • synchronized: wraps an iterator-returning callable to make its iterators
    thread-safe (thanks to rhettinger)
  • sized_iterator: wraps an iterable with a known length and implements __len__ (thanks to assaf127)

Changes to existing functions

  • The type hints for always_iterable were improved (thanks to rhettinger and maltevesper)
  • A potential bug in callback_iter was fixed
  • A bug in exactly_n's handling of negative arguments was fixed (thanks to rhettinger)
  • extract`` now accepts a monotonic` argument for improved performance (thanks to rhettinger)
  • A bug in numeric_range's handling of negative steps was fixed (thanks to bysiber)
  • grouper implementation was updated to match the itertools docs (thanks to rhettinger)
  • nth_product, product_index, gray_product,
    partial_product, nth_product, product_index, and
    random_product now accept a repeat keyword argument (thanks to rhettinger)
  • powerset_of_sets can now construct frozenset instances (thanks to rhettinger)
  • The type hints for stagger were improved (thanks to nathanjmcdougall)
  • Memory efficiency was improved for partition was improved (thanks to rhettinger and yueyinqiu)
  • Performance for the functions count_cycle, difference,
    random_product, was improved nth_combination, nth_combination_with_replacement,
    nth_permuwas improvedtation, nth_product, product_index,
    random_permutation, substrings, and value_chain was
    improved (thanks to rhettinger)
  • Performance for ichunked was improved (thanks to pochmann3 and rhettinger)

Other changes

  • The docstrings for several functions were improved (thanks to nathanjmcdougall, olliemath, r266-tech, and rhettinger)

Version 10.8.0

02 Sep 15:24
8c1a6ef

Choose a tag to compare

What's Changed

  • Fix typo in version history for 10.7.0 by bbayles in #981
  • Issue 980: Fix variable names: iterable vs iterator by rhettinger in #982
  • Improve docstrings for dft, idft, and multinomial by rhettinger in #983
  • Add a note about polynomial endianness by bbayles in #984
  • Add SPDX license identifier by cdce8p in #978
  • Remove setup.py file by cdce8p in #979
  • Include derangements by itself by bbayles in #985
  • Add derangements by debruijn in #946
  • Issue 986: argmin and argmax by bbayles in #988
  • Split-out the integer math functions by rhettinger in #990
  • Spelling, grammar, punctuation, and usage by rhettinger in #991
  • Fix the return type of more_itertools.batched by qobilidop in #993
  • Fix duplicate words in version_history.rst by saadmanrafat in #992
  • Improve islice_extended memory usage when start<0 and step>0 by ben42code in #995
  • Unittest islice_extended impact on iterated elements lifecycle by ben42code in #996
  • convolve() is agnostic to endianness by rhettinger in #997
  • Sample simplification by rhettinger in #998
  • Issue 1005: Document difference from builtin min() and max(). by rhettinger in #1008
  • General cleanups by rhettinger in #1007
  • Fix broken link by rhettinger in #1004
  • Add option for nth_prime() to be approximated by rhettinger in #1002
  • before_and_after improvement by pochmann3 in #1012
  • Fast paths instead of applying an identity function by rhettinger in #1018
  • Speed-up _complex_sumprod() by rhettinger in #1000
  • Improve islice_extended memory usage when stop<0 and step>0 by ben42code in #999
  • Add derangements() to the doc indexes by rhettinger in #1020
  • Improve readability/findability with combinatoric subsections by rhettinger in #1022
  • Fix 1009: Confused docstring for minmax() by rhettinger in #1021
  • Improve interleave_longest by pochmann3 in #1027
  • Issue 1001: fix last() when reversed is None by inventshah in #1028
  • Issue 1029: fix batched IDE/help() docs by inventshah in #1031
  • Improve mark_ends by pochmann3 in #1035
  • Add usage notes for sample() by rhettinger in #1037
  • Fix docstring and comment in private _nth_prime_bounds function by rhettinger in #1036
  • Fix linespacing by rhettinger in #1038
  • Add running_median by rhettinger in #1039
  • running_median() with windowed data by rhettinger in #1040
  • Pin furo to 2024.08.06 by bbayles in #1043
  • docs: Fix invisible REPL output in HTML dark mode by moreati in #1045
  • Use python instead of python3 when running tests by ktbarrett in #1051
  • Issue 1044: Add new tool: extract() by rhettinger in #1056
  • Test 3.14.0-rc.2 by bbayles in #1060
  • unzip: replace custom itemgetter by pochmann3 in #1059
  • Add interleave_randomly by ktbarrett in #1048
  • Issue 1003: Multidimensional reshape() by rhettinger in #1062
  • Get coverage to 100% by rhettinger in #1065
  • Improve count_cycle() by rhettinger in #1066
  • Clarify how derangements treats duplicate inputs by rhettinger in #1069
  • Readability improvement for reshaped() by rhettinger in #1067
  • Clean-up tail(). Prefer try/except over the Sized ABC. by rhettinger in #1068
  • Version 10.8.0 by bbayles in #1071

Full Changelog: v10.7.0...v10.8.0

Version 10.7.0

22 Apr 14:19
28ab736

Choose a tag to compare

See the change log here for details.

Version 10.6.0

14 Jan 16:25

Choose a tag to compare

  • New functions:

    • is_prime and nth_prime were added (thanks to JamesParrott and rhettinger)
    • loops was added (thanks to rhettinger)
  • Changes to existing functions:

    • factor was optimized to handle larger inputs and use less memory (thanks to rhettinger)
    • spy was optimized to enable nested calls (thanks to rhettinger)
    • polynomial_from_roots was made non-recursive and able to handle larger numbers of roots (thanks to pochmann3 and rhettinger)
    • is_sorted now only relies on less than comparisons (thanks to rhettinger)
    • The docstring for outer_product was improved (thanks to rhettinger)
    • The type annotations for sample were improved (thanks to rhettinger)
  • Other changes:

    • Python 3.13 is officially supported. Python 3.8 is no longer officially supported. (thanks to hugovk, JamesParrott, and stankudrow)
    • mypy checks were fixed (thanks to JamesParrott)

v10.5.0

06 Sep 12:10
4998a25

Choose a tag to compare

What's Changed

Full Changelog: v10.4.0...v10.5.0

Version 10.4.0

07 Aug 14:20

Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v10.3.0...v10.4.0

Version 10.3.0

10 Jun 14:25
7e46c39

Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v10.2.0...v10.3.0

Version 10.2.0

08 Jan 15:45
1e0e662

Choose a tag to compare

  • New functions

    • iter_suppress (thanks to jaraco, pochmann, and rhettinger)
    • filter_map (thanks to struktured)
    • classify_unique (thanks to haukex)
    • totient (from the itertools docs)
    • reshape (from the itertools docs)
  • Changes to existing functions

    • factor, iter_index, sieve, and unique_justseen were updated to match the itertools docs
    • first was was optimized (thanks to pochmann)
    • takewhile_inclusive was was refactored (thanks to eltoder)
    • combination_with_replacement_index was was optimized (thanks to elliotwutingfeng and rhettinger)
    • nth_permutation, nth_combination_with_replacement, combination_index, and combination_with_replacement_index were optimized (thanks to rhettinger)
    • batched now accepts a strict argument (adapted from itertools docs)
    • time_limited was improved for Windows (thanks to haukex)
  • Other changes

    • Several typing updates were made (thanks to obaltian and ilai-deutel)
    • Some documentation issues were fixed (thanks to F-park, DimitriPapadopoulos, peterbygrave, shuuji3, eltoder, and homeworkprod)

Version 10.1.0

04 Aug 13:37
266ebdc

Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v10.0.1...v10.1.0