Skip to content

Release 0.6.3

Choose a tag to compare

@OutSquareCapital OutSquareCapital released this 08 Jan 21:33
· 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 _inner type annotation -> No need to manually write __init__ in subclasses anymore
  • __iter__ and iter methods 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 -> I for container type, T for item type
  • Must define _inner: I attribute 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

  • Option and Result now have map_star() and and_then_star() methods for unpacking tuples in mapping functions
  • Vec now has an optimized sort() method using list.sort() for in-place sorting
  • Removed more-itertools dependency β€” all functionality is now implemented internally
  • New try_find(), try_reduce(), and try_fold() methods on Iter for error-aware iteration when dealing with Iterator of Result
  • New collect_into() method on Iter to 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.value instead of self.unwrap() to avoid redundant function calls in internal implementations
  • Global imports β€” Moved Option and Result imports 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 Iter only): 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.