Edges of Python Three Radical Python Hacks for Fun and Profit
summary
Three concrete hacks: a tiny sync shim that starts coroutines with coro.send(None) and replaces async streams with blocking sockets to reuse one async codebase as a synchronous client (works for simple network stacks but loses create_task/timeouts and adds marginal call overhead); using an immutables persistent map (HAMT) to get structural sharing instead of expensive full dict copies (copies become noticeable around ~10k entries, ~1 ms); and a value-dispatch pattern (dispatch on values not just types) with a reference implementation in the EdgeDB repo.
AI-written summary · about
chapters (6)
- 0:00Introduction to hacks
- 1:08Async to sync client conversion
- 9:16In-memory transaction atomicity
- 14:57Persistent maps for performance
- 17:29Value-based dispatch patterns
- 18:33Q&A and closing remarks
related talks
30mAn Admin's Cornucopia - Python Is More Than Just A Better Bash
24m"A Confession of My Python Sins"
01h 29mStandardised Coroutine Concurrency in Python 3
47mTaking Asynchronous Python to the Next Level Using Trio
33mArtisanal Async Adventures
20mAsync Rust Meets Async Python: How Daft runs user defined Python coroutines from Tokio
25mPython as a Hackable Language for Interactive Data Science
57mTechniques learned from five years finding the way for Rust in Python
