Every program here runs with uv run poop <path>. POOP ships 44 programs across three subfolders, grouped by what they teach.
Language basics (basics/)
hello_world.pyβ the smallest POOP programgreet.pyβ string input + concatenationfizzbuzz.pyβ control flow viaif_true_if_falseleap_year.pyβand_/or_/not_collatz.pyβ while-style recursiongrades.pyβ collection processingstring_iteration.pyβ a string is a collection tooslicing.pyβSliceas a reusable value objectbank_account.pyβ encapsulation
Idiomatic POOP (idiomatic/)
pipeline.pyβfilter/filter_false/map/dochainsafe_config.pyβif_none/if_not_nonecascadecommon_interests.pyβ set operationsstatistics.pyβ number aggregationrpn_calculator.pyβ stack as a POOPListroman_numerals.pyβ string mappingmanaged_resource.pyβWithand the__exit__protocol
Classic OO patterns (Sandi Metz / GoF) (patterns/)
Creational
abstract_factory.pyβ Abstract Factorybuilder.pyβ Builderfactory_method.pyβ Factory Methodprototype.pyβ Prototype (cloning a configured example)singleton.pyβ Singleton (class-side cached instance)
Structural
adapter.pyβ Adapterbridge.pyβ Bridgetree.pyβ Composite (replacingisinstance)decorators.pyβ Decorator (composition by delegation)facade.pyβ Facadeflyweight.pyβ Flyweight (shared intrinsic state)proxy.pyβ Proxy (lazy-loading virtual proxy)
Behavioral
chain_of_responsibility.pyβ Chain of Responsibilitycommand.pyβ Command (with undo)interpreter.pyβ Interpreteriterator.pyβ Iteratormediator.pyβ Mediatormemento.pyβ Mementoobserver.pyβ Observerdoor.pyβ Statediscounts.pyβ Strategytemplate_method.pyβ Template Methodvisitor.pyβ Visitor
Other OO patterns (Fowler / Beck / Evans / Metz)
null_customer.pyβ Null Objectpayroll.pyβ polymorphism replacingif employee.type == ...specification.pyβ Specification (composable rules replacingand/or/not)money.pyβ Money value objectexecute_around.pyβ Execute Around Method