ty 1.0 demo: satisfies_all infers length-plus-integer constraints across predicates

charliermarsh · x · 2026-12-02

Charlie Marsh (Astral) shares an example from the ty 1.0 blog post: satisfiesall conjoins an arbitrary number of predicates. In the demo, validbatch requires an input that has a length and yields integers — ty infers this and accepts [1, 2, 3] while rejecting iter([1, 2, 3]) (iterators lack a length), showcasing the type checker's inference over compound predicates.

Original post →

More from coding & agent

coding & agent channel →