⚠️ This implementation may be out of date or contain bugs. Last updated 2026-08-25.
PEP 845 Implementation

Demo for PEP 845

Explore the semantics of the proposal with this interactive WebAssembly demo. Write Python code in the editor, run it in your browser, or experiment in the interactive REPL.

PEP 845 - Leading-Dot Value Patterns

discuss.python.org thread →

📜 Read PEP 845 Specification

Code Editor

# Example using PEP 845 BOOKS: list[dict[str, str]] = [ { "author": "William Shakespeare", "title": "Hamlet", }, { "author": "William Shakespeare", "title": "Romeo and Juliet", }, { "author": "Charles Dickens", "title": "A Christmas Carol", }, { "author": "Charles Dickens", "title": "A Tale of Two Cities", } ] def get_book_titles_for_author(author: str): for book in BOOKS: match book: case {"title": title, "author": .author}: yield title print("Titles by Shakespeare:") for title in get_book_titles_for_author("William Shakespeare"): print(f"- {title}")

Terminal Output

Interactive REPL

Note: This is an experimental WebAssembly build of Python. Some features like networking, subprocesses, and threading are not available. Please report issues regarding the demo or implementation to the implementation repository .