v0.0.22

pydantic/montyv0.0.22Sep 4, 2026by samuelcolvin

AI Summary

This release focuses on stabilizing the Python implementation by fixing critical container representation panics, enhancing resource tracking, and implementing core parts of the standard library such as `functools`, `datetime.time`, and `base64`. It also introduces significant improvements to the REPL, documentation, and internal data structures.

Key Highlights

  • Fixes critical panics in container `__repr__` and iteration when user code mutates the container.
  • Adds core standard library modules including `functools`, `datetime.time`, and `base64`.
  • Enhances REPL functionality with better string continuation and decorator support.
  • Improves resource management with a new `max_suspensions` limit and resource tracker tweaks.
  • Expands documentation with a new site and API reference pages.

Breaking Changes

  • Reject unknown keys in the limits dict instead of silently ignoring them.
  • Raise instead of aborting when the async scheduler stalls.

New Features

  • Add `functools` module with `reduce` and `partial`.
  • Add `itertools` adaptors: `takewhile`, `dropwhile`, `filterfalse`, `starmap`.
  • Add `object` and `object.__setattr__` for hook-bypassing writes.
  • Add `datetime.time` implementation.
  • Add `base64` module with `ascii85` support.
  • Support `@dataclass(eq=..., frozen=...)` decorators.
  • Implement `max_suspensions` in `ResourceLimits`.
  • Send custom headers on WebSocket transport.

Full Release Notes

## What's Changed
* Better python executables and readmes by @samuelcolvin in https://github.com/pydantic/monty/pull/703
* Fix container repr panics when a user `__repr__` mutates the container by @samuelcolvin in https://github.com/pydantic/monty/pull/705
* Tweaks to resource tracker intermittence by @samuelcolvin in https://github.com/pydantic/monty/pull/706
* Fix `StackFrame` wire validation rejecting multi-line spans by @samuelcolvin in https://github.com/pydantic/monty/pull/714
* Reject unknown keys in the limits dict instead of silently ignoring them by @samuelcolvin in https://github.com/pydantic/monty/pull/723
* update `package-lock.json` and improve pre-commit by @samuelcolvin in https://github.com/pydantic/monty/pull/737
* Arm `pending_os_effect` only at the host boundary by @rewitt94 in https://github.com/pydantic/monty/pull/722
* writing style skill and update limitations by @samuelcolvin in https://github.com/pydantic/monty/pull/738
* Warn about read-write mounts in the mount docstrings by @samuelcolvin in https://github.com/pydantic/monty/pull/735
* Server docs by @samuelcolvin in https://github.com/pydantic/monty/pull/743
* End `itertools.chain` when an argument fails by @rewitt94 in https://github.com/pydantic/monty/pull/748
* Avoid stack overflow in nested asyncio task chains by @jay3cx in https://github.com/pydantic/monty/pull/704
* Fix OverflowError for a large 32-bit usize by @rewitt94 in https://github.com/pydantic/monty/pull/746
* Stop wasm type-check feeds serving stale Salsa results by @rewitt94 in https://github.com/pydantic/monty/pull/756
* Clarify server quickstart by @dmontagu in https://github.com/pydantic/monty/pull/757
* Clarify server operations documentation by @dmontagu in https://github.com/pydantic/monty/pull/758
* Drop map values on error paths by @smigolsmigol in https://github.com/pydantic/monty/pull/750
* Propagate overlay directory listing errors by @smigolsmigol in https://github.com/pydantic/monty/pull/749
* Tear down blocked task chains iteratively by @rewitt94 in https://github.com/pydantic/monty/pull/747
* Support `@dataclass(eq=..., frozen=...)` by @rewitt94 in https://github.com/pydantic/monty/pull/650
* Add `itertools` adaptors: `takewhile`, `dropwhile`, `filterfalse`, `starmap` by @rewitt94 in https://github.com/pydantic/monty/pull/657
* Raise instead of aborting when the async scheduler stalls by @rewitt94 in https://github.com/pydantic/monty/pull/764
* avoid passing `self_id` around by @davidhewitt in https://github.com/pydantic/monty/pull/765
* Add `object` and `object.__setattr__`, the hook-bypassing write by @rewitt94 in https://github.com/pydantic/monty/pull/728
* use `HeapObjectRead` to reduce `self_id` passing by @davidhewitt in https://github.com/pydantic/monty/pull/770
* docs: add a documentation site and a docs/README parity system by @dsfaccini in https://github.com/pydantic/monty/pull/660
* Dispatch `__index__` for indexing, slicing and integer arguments by @rewitt94 in https://github.com/pydantic/monty/pull/654
* remove `CachedFrame` concept by @davidhewitt in https://github.com/pydantic/monty/pull/762
* Add the `functools` module with `reduce` by @rewitt94 in https://github.com/pydantic/monty/pull/760
* Fix REPL continuation after decorators by @hrissan in https://github.com/pydantic/monty/pull/776
* Compile Rust quickstart examples in CI by @smigolsmigol in https://github.com/pydantic/monty/pull/774
* Reuse exact positional arguments as function frame locals by @KRRT7 in https://github.com/pydantic/monty/pull/701
* Continue REPL input for triple-quoted strings by @hrissan in https://github.com/pydantic/monty/pull/778
* fix(dict): raise 'dictionary changed size during iteration' on last-element mutation by @IgorKasianenko in https://github.com/pydantic/monty/pull/751
* Add the `base64` module by @rewitt94 in https://github.com/pydantic/monty/pull/761
* add `allocate_as` helper for typed allocation by @davidhewitt in https://github.com/pydantic/monty/pull/781
* bump `ruff` crates by @davidhewitt in https://github.com/pydantic/monty/pull/777
* Fix stale-index panics when a user `__eq__` mutates the container mid-lookup by @rewitt94 in https://github.com/pydantic/monty/pull/783
* Let a failing `gather` leave its siblings running by @rewitt94 in https://github.com/pydantic/monty/pull/772
* docs: clarify Python subset implemented by @davidhewitt in https://github.com/pydantic/monty/pull/785
* Clamp sequence-search bounds the way CPython does by @rewitt94 in https://github.com/pydantic/monty/pull/780
* Name the class in builtin-type attribute errors by @rewitt94 in https://github.com/pydantic/monty/pull/782
* add id to default object repr to match CPython by @davidhewitt in https://github.com/pydantic/monty/pull/786
* Implement `datetime.time` by @rewitt94 in https://github.com/pydantic/monty/pull/773
* fix(json): clean up object keys when value parsing fails by @trungminhdo4-glitch in https://github.com/pydantic/monty/pull/768
* remove `EitherStr` hash by @davidhewitt in https://github.com/pydantic/monty/pull/793
* refactor PGO implementation by @davidhewitt in https://github.com/pydantic/monty/pull/553
* Lend, don't clone, a suspension's payload when announcing it by @samuelcolvin in https://github.com/pydantic/monty/pull/699
* recreate fix for 712 against `main` by @davidhewitt in https://github.com/pydantic/monty/pull/792
* move TS protobuf logic to Rust using wasi p2  by @davidhewitt in https://github.com/pydantic/monty/pull/658
* Vendor `_typeshed/_type_checker_internals.pyi` so TypedDict attribute access is rejected by @samuelcolvin in https://github.com/pydantic/monty/pull/802
* Add `functools.partial` by @rewitt94 in https://github.com/pydantic/monty/pull/787
* Argument and attribute handling on builtin methods by @rewitt94 in https://github.com/pydantic/monty/pull/797
* Commit gathers with an explicit stack instead of capping nesting by @rewitt94 in https://github.com/pydantic/monty/pull/794
* Fix flakey CI on set repr by @samuelcolvin in https://github.com/pydantic/monty/pull/804
* Match CPython on both halves of a type's name by @rewitt94 in https://github.com/pydantic/monty/pull/796
* Replace wire `Dataclass` with `ClassInstance` carrying instance identity by @samuelcolvin in https://github.com/pydantic/monty/pull/682
* match CPython for some float rounding behaviour by @davidhewitt in https://github.com/pydantic/monty/pull/807
* Generate API reference pages for the docs site by @samuelcolvin in https://github.com/pydantic/monty/pull/803
* Add `max_suspensions` to `ResourceLimits`, enforced by the host via `AbortFeed` by @samuelcolvin in https://github.com/pydantic/monty/pull/806
* Move REPL compiler tables into each snippet instead of cloning them by @samuelcolvin in https://github.com/pydantic/monty/pull/808
* Add the ascii85 pair to `base64` by @rewitt94 in https://github.com/pydantic/monty/pull/790
* Record pool and turn metrics through the telemetry adapter by @samuelcolvin in https://github.com/pydantic/monty/pull/686
* feat: send custom headers on the WebSocket transport by @JonasKs in https://github.com/pydantic/monty/pull/759
* Bump version to v0.0.22 by @samuelcolvin in https://github.com/pydantic/monty/pull/814

## New Contributors
* @jay3cx made their first contribution in https://github.com/pydantic/monty/pull/704
* @dmontagu made their first contribution in https://github.com/pydantic/monty/pull/757
* @dsfaccini made their first contribution in https://github.com/pydantic/monty/pull/660
* @hrissan made their first contribution in https://github.com/pydantic/monty/pull/776
* @KRRT7 made their first contribution in https://github.com/pydantic/monty/pull/701
* @IgorKasianenko made their first contribution in https://github.com/pydantic/monty/pull/751
* @trungminhdo4-glitch made their first contribution in https://github.com/pydantic/monty/pull/768
* @JonasKs made their first contribution in https://github.com/pydantic/monty/pull/759

**Full Changelog**: https://github.com/pydantic/monty/compare/v0.0.21...v0.0.22