Repository navigation
Release 0.6.3
·
2014 commits
to master
since this release
π pyochain 0.6.3 β Release Notes
Date: 2026-01-07 π
π Highlights
- PyoIterable complete overhaul
- Performance improvements
- New methods
- Removed more-itertools dependency
π API Changes
Major Refactor: PyoIterable Trait Complete Overhaul
What Changed
- PyoIterable now automatically generates optimized
__init__methods based on_innertype annotation -> No need to manually write__init__in subclasses anymore __iter__anditermethods are now provided thanks to the new generic signature of the base class and no longer need to be defined in subclasses- Must provide two generics ->
Ifor container type,Tfor item type - Must define
_inner: Iattribute in subclasses to specify the underlying container
Example:
>>> from pyochain.traits import PyoIterable
>>>
>>> class MyList(PyoIterable[list[int], int]):
... _inner: list[int]
>>> # No need to define __init__ or __iter__
>>> my_list = MyList([1, 2, 3])
>>> my_list
MyList(1, 2, 3)
>>> my_list.iter().collect()
Seq(1, 2, 3)New Features
OptionandResultnow havemap_star()andand_then_star()methods for unpacking tuples in mapping functionsVecnow has an optimizedsort()method usinglist.sort()for in-place sorting- Removed
more-itertoolsdependency β all functionality is now implemented internally - New
try_find(),try_reduce(), andtry_fold()methods onIterfor error-aware iteration when dealing withIteratorofResult - New
collect_into()method onIterto append items directly into existing collections in a fluent way
β‘ Performance Improvements
- Eliminated more-itertools overhead β All functionality now internal, removing external call indirection
- Optimized Result/Option internals β Using
self.valueinstead ofself.unwrap()to avoid redundant function calls in internal implementations - Global imports β Moved
OptionandResultimports to module level, eliminating repeated import overhead in methods - Split method optimizations internals β Improved constructor locality for better performance
π§ Breaking Changes
PyoIterable now ONLY provides aggregation methods:
- Removed from PyoIterable (moved to
Iteronly):find(),reduce(),fold(),sort(),tail(),top_n(),most_common()
Migration:
# Before
seq.find(predicate)
seq.sort()
seq.top_n(5)
# After
seq.iter().find(predicate)
seq.iter().sort().collect()
seq.iter().top_n(5).collect()β οΈ Removed Niche Methods
The following methods have been permanently removed from Iter:
- β
unique_justseen() - β
unique_in_window() - β
extract() - β
adjacent() - β
classify_unique() - β
combination_index()
Migration: Use .into(func) with equivalent functions from more_itertools if you need these operations.
π Dependency Changes
Removed:
more-itertools>=10.8.0β All functionality left extracted internally
Questions? Report issues on our GitHub Issues page.