Releases: more-itertools/more-itertools
Releases · more-itertools/more-itertools
Version 11.0.1
Version 11.0.0
Potentially breaking changes
- Python 3.9 support was dropped, since it went EOL on 2025-10-31
callback_iteris deprecated. It will be removed in a future major release.iequalsno longer returnsTruewhen called with([], [ANY])(thanks to rhettinger and pochmann3)- The
predargument forlocateandreplacemust now be able to
handle a variable number of arguments. See their docstrings for details. (thanks to veeceey, james-wasson, and pochmann3) unique_everseennow raisesTypeErrorwhen input elements are not hashable.
The silent fallback mechanism for unhashable inputs has been removed. (thanks to rhettinger and karlicoss)windowednow raisesValueErrorwhen given a window size of0(thanks to rhettinger and brevzin)- Parameter names for
flatten,iter_except,repeatfunc,prepend,transpose,
andsum_of_squareshave 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 totee, 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_iterablewere improved (thanks to rhettinger and maltevesper) - A potential bug in
callback_iterwas fixed - A bug in
exactly_n's handling of negative arguments was fixed (thanks to rhettinger) extract`` now accepts amonotonic` argument for improved performance (thanks to rhettinger)- A bug in
numeric_range's handling of negative steps was fixed (thanks to bysiber) grouperimplementation was updated to match theitertoolsdocs (thanks to rhettinger)nth_product,product_index,gray_product,
partial_product,nth_product,product_index, and
random_productnow accept arepeatkeyword argument (thanks to rhettinger)powerset_of_setscan now constructfrozensetinstances (thanks to rhettinger)- The type hints for
staggerwere improved (thanks to nathanjmcdougall) - Memory efficiency was improved for
partitionwas improved (thanks to rhettinger and yueyinqiu) - Performance for the functions
count_cycle,difference,
random_product, was improvednth_combination,nth_combination_with_replacement,
nth_permuwas improvedtation,nth_product,product_index,
random_permutation,substrings, andvalue_chainwas
improved (thanks to rhettinger) - Performance for
ichunkedwas 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
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
derangementsby 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_longestby 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_endsby 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_randomlyby 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
See the change log here for details.
Version 10.6.0
-
New functions:
is_primeandnth_primewere added (thanks to JamesParrott and rhettinger)loopswas added (thanks to rhettinger)
-
Changes to existing functions:
factorwas optimized to handle larger inputs and use less memory (thanks to rhettinger)spywas optimized to enable nested calls (thanks to rhettinger)polynomial_from_rootswas made non-recursive and able to handle larger numbers of roots (thanks to pochmann3 and rhettinger)is_sortednow only relies on less than comparisons (thanks to rhettinger)- The docstring for
outer_productwas improved (thanks to rhettinger) - The type annotations for
samplewere 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)
mypychecks were fixed (thanks to JamesParrott)
v10.5.0
Version 10.4.0
What's Changed
- Issue 854: sample improvements by @bbayles in #855
- Issue 858: Use chain and starmap in run_length.decode by @bbayles in #861
- Issue 859: Update totient recipe by @bbayles in #860
- Distinct permutations of incomparable items by @JamesParrott in #834
- Clarify seekable.relative_seek behavior by @bbayles in #863
- Issue 864: Improve _sample_unweighted by @bbayles in #865
- Use log1p for _sample_unweighted by @bbayles in #868
- Issue 862: change relative_seek() behaviour by @dkrikun in #866
- Issue 876: is_sorted clarifications by @bbayles in #877
- Issue 870: counts parameter for sample by @bbayles in #875
- Issue 869: Add a steps argument to circular_shifts by @bbayles in #874
- Issue 871: Add a fast path for sliding_window by @bbayles in #873
- type annotation of
windowed_completecorrected by @m472 in #881 - [Docs] Fix strictly_n missing the n parameter by @fakuivan in #886
- Standardize type hints for isinstance's second argument by @jbosboom in #887
- Issue 883: change type hint by @akisatoon1 in #884
- Add type overloads for
zip_broadcastby @Pandede in #888 - Issue 889: Optimize triplewise by @bbayles in #891
- Add option
stricttosort_togetherby @Pandede in #892 - Updates for version 10.4.0 by @bbayles in #893
New Contributors
- @JamesParrott made their first contribution in #834
- @dkrikun made their first contribution in #866
- @m472 made their first contribution in #881
- @fakuivan made their first contribution in #886
- @jbosboom made their first contribution in #887
- @akisatoon1 made their first contribution in #884
- @Pandede made their first contribution in #888
Full Changelog: v10.3.0...v10.4.0
Version 10.3.0
What's Changed
- 100% Code Coverage by @haukex in #792
- Remove recursion from
collapseby @james-wasson in #796 - Closes #780: add pre/postpend examples in value_chain doc by @bjrtx in #802
- Increase performance of
paddedby @james-wasson in #805 - Update table of contents by @bjrtx in #808
- Add exactly size of n doc to padded by @james-wasson in #807
- Speed up
ichunkedby @james-wasson in #793 - Optimize
chunked_evenitertool by @james-wasson in #816 - Optimize windowed itertool by @james-wasson in #810
- Issue 822: update iter_index docs by @bbayles in #827
- Issue 823: improve totient by @bbayles in #826
- Issue 821: key argument for all_equal by @bbayles in #825
- Update roundrobin implementation by @bbayles in #829
- Issue 820: add powerset_of_sets by @bbayles in #828
- Fix a typo found by codespell by @DimitriPapadopoulos in #830
- Add typing for countable.items_seen attribute. by @aidanholm in #836
- Add join_mappings by @bbayles in #841
- Add doublestarmap (closes #679) by @monk-time in #845
- Add dft and idft by @bbayles in #847
- Changes for version 10.3.0 by @bbayles in #851
- Add unique() by @bbayles in #850
New Contributors
- @james-wasson made their first contribution in #796
- @bjrtx made their first contribution in #802
- @aidanholm made their first contribution in #836
- @monk-time made their first contribution in #845
Full Changelog: v10.2.0...v10.3.0
Version 10.2.0
-
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, andunique_justseenwere updated to match the itertools docsfirstwas was optimized (thanks to pochmann)takewhile_inclusivewas was refactored (thanks to eltoder)combination_with_replacement_indexwas was optimized (thanks to elliotwutingfeng and rhettinger)nth_permutation,nth_combination_with_replacement,combination_index, andcombination_with_replacement_indexwere optimized (thanks to rhettinger)batchednow accepts astrictargument (adapted from itertools docs)time_limitedwas 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
What's Changed
- Add more tests for
zip_broadcast()by @kalekundert in #739 - Added takewhile_inclusive by @OlegAlexander in #736
- Speed up
zip_broadcast()by pre-filling the scalar elements by @kalekundert in #740 - Added outer_product. by @OlegAlexander in #743
- Simplify
zip_broadcastby @pochmann in #742 - Simplify
_zip_equalby @pochmann in #744 - fix consume() type annotation by @obaltian in #746
- Version 10.1.0 by @bbayles in #747
New Contributors
- @OlegAlexander made their first contribution in #736
- @obaltian made their first contribution in #746
Full Changelog: v10.0.1...v10.1.0