Python Trending Weekly
ISSUE 78

Why async/await Might Be a Terrible Design Choice

2024-11-23 Season 3

TL;DR

Playground wisdom argues threads beat async/await while Django's async readiness is questioned, FireDucks claims Pandas at 100x speed, and garak scans LLMs for vulnerabilities.

Articles 12 Projects 12 Media 1
🦄

Articles & Tutorials

× 12
01 Playground Wisdom: Threads Beat Async/Await lucumr.pocoo.org

The author argues that async/await is a terrible abstraction for most programming languages, and threads are the superior approach. While it rescued us from callback hell, it introduced new headaches like "colored functions" and backpressure challenges that block us from achieving straightforward, intuitive concurrency. The piece suggests new language designs should adopt virtual thread models similar to Java's Loom project. (Bonus: The article repeatedly references this classic piece I'm not feeling the async pressure)

02 Is Python Really That Slow? blog.miguelgrinberg.com

This performance comparison pits Python against Node.js and Rust using Fibonacci calculations and bubble sort benchmarks. The results? Python 3.11 shows significant improvements over its predecessor, while PyPy nearly matches Node.js in speed. The author is genuinely impressed by Python's recent performance gains and surprised by PyPy's capabilities.

03 Django Async: Ready for Prime Time? jonathanadly.com

What should you watch out for when going full async with Django? This comprehensive guide covers everything from ASGI web servers and async views to async ORM, API calls, and middleware. The verdict? Async Django is production-ready—here's what you need to know before making the switch.

04 Why Durable Execution Should Be Lightweight dbos.dev

Durable execution lets your workflows survive crashes, restarts, and interruptions by restoring to their exact previous state. DBOS's lightweight implementation uses Postgres to store workflow states and step outputs, enabling features like durable sleep, messaging, and queues while dramatically simplifying development, deployment, and maintenance.

05 Pipeline Pattern in Python — Implemented via Operator Overloading un4gt.github.io

Last week we saw pipeline patterns implemented with reduce and lambda functions. This approach takes it further by overloading operators, making the syntax feel much closer to Linux's native pipe operators. (Shared by @un4gt)

06 FireDucks : Pandas but 100x faster hwisnu.bearblog.dev

The benchmarks are jaw-dropping: FireDucks averages 50x faster than Pandas, outperforms Polars, and even beats DuckDB! With 100% Pandas compatibility and blazing speed, this looks like a game-changer for data processing.

07 Any Python program fits in 24 characters* purplesyringa.moe

Can any Python program really be compressed to just 24 characters (excluding whitespace)? This mind-bending article maps Unicode whitespace code points to specific characters, achieving the ultimate in code compression wizardry.

08 PEP 765 – Disallow return/break/continue that exit a finally block peps.python.org

A new PEP draft proposes banning return/break/continue statements that exit finally blocks. Why? They swallow exceptions and can override return values from try clauses, leading to subtle bugs that are hard to track down.

09 CPython's Garbage Collector and its Impact on Application Performance blog.codingconfessions.com

A deep dive into CPython's memory management, focusing on the cyclic garbage collector. Learn how it works, when it triggers, and most importantly—how it impacts your application's performance. Packed with optimization tips including GC threshold tuning, weak references, and data structure optimization strategies.

10 The Practical Guide to Scaling Django slimsaas.com

The author advocates for eliminating bottlenecks incrementally as your system grows. This practical guide covers common optimization strategies including query optimization, database indexing, queryset optimization, view-level caching, template fragment caching, low-level cache APIs, async views with background tasks, and load balancing techniques.

11 SQL, Homomorphisms and Constraint Satisfaction Problems philipzucker.com

SQL isn't just for database queries—it can solve surprisingly complex problems like Sudoku puzzles and programming challenges. This article demonstrates SQL's power in tackling graph homomorphisms and constraint satisfaction problems, often outperforming pure Python solutions.

12 Pleasant debugging with GDB and DDD begriffs.com

GDB might be the venerable Linux/BSD debugger, but it's far from outdated. Learn how to customize GDB interfaces, configure DDD, master debugging techniques, and leverage GDB's Python API to create helper functions and beautiful pretty-printers that make debugging actually enjoyable.

🐿️

Projects & Resources

× 12
01 pyTermTk: a Spiced Up Cross Compatible TUI Library github.com

A feature-rich TUI library with essential widgets (buttons, labels, checkboxes), specialized components (Windows, Frames, Tables), true color support, and full/half/zero-width Unicode characters. Perfect for building modern terminal interfaces.

02 terminal-tree: A File System Navigator in the Terminal github.com

Navigate your filesystem tree directly in the terminal using keyboard or mouse. Features file previews, path completion and validation, and path component navigation for a smooth file browsing experience.

03 chdb: an in-process OLAP SQL Engine github.com

Powered by ClickHouse, this in-process SQL OLAP engine supports 60+ formats including Parquet, CSV, JSON, Arrow, and ORC. Fully compatible with Python DB API 2.0. (2.2K stars)

chdb: an in-process OLAP SQL Engine
04 open-notebook: An Open Source Implementation of Notebook LM github.com

Multi-notebook support, multiple AI models, note-to-podcast conversion, extensive content integration, AI-powered note-taking, built-in search engine, and sophisticated context management. Your open-source alternative to Google's Notebook LM.

05 garak: the LLM vulnerability scanner github.com

Comprehensive LLM security scanning that detects hallucinations, data leaks, prompt injection, misinformation, harmful content, and jailbreak attempts. Essential for securing your AI applications. (2.7K stars)

06 EasyAnimate: An End-to-End Solution for High-Resolution and Long Video Generation github.com

A complete Transformer-based pipeline for generating high-resolution images and videos, plus baseline models and LoRA models for training Diffusion Transformers. End-to-end AI content creation made easy. (1.5K stars)

07 ASCII-generator: ASCII generator github.com

Famous content creator He Tongxue famously modified this project and called it "specially written software"... Convert images to ASCII text, images to ASCII art, and videos to ASCII animations. The ultimate ASCII transformation toolkit. (6K stars)

ASCII-generator: ASCII generator
08 leopards: Query Your Python Lists github.com

Query your lists of dictionaries or objects like you're using a proper database. Filter with OR, AND, and NOT operations. Surprisingly faster than Pandas for many use cases.

09 Distributed Systems 4th edition distributed-systems.net

The 4th edition of the classic Distributed Systems textbook, featuring numerous corrections and all Python code updated to Python 3. Essential reading for understanding modern distributed systems.

10 ebook2audiobook: Generates an audiobook with chapters and ebook metadata using Calibre and Xtts github.com

Transform your ebooks into audiobooks with proper chapters and metadata using Calibre and Coqui XTTS. Optional voice cloning and multi-language support included! (1K stars)

11 pensieve: A passive recording project allows you to have complete control over your data github.com

A privacy-focused passive recording system that automatically captures your screen, builds intelligent indexes, and provides a convenient web interface for searching through your digital history. All data stays local—no cloud required.

12 yami: An open-source music player with simple UI github.com

A lightweight, cross-platform music player built with Python. Clean, minimalist UI with support for local files and online downloads via spotdl. Simple and elegant music playback done right.

yami: An open-source music player with simple UI
🐢

Podcasts & Videos

× 1
01 PyData Tel Aviv 2024 Video Playlist (24 videos) youtube.com

PyData Tel Aviv is a vibrant conference and community focused on PyData projects, bringing together data analysis, data science, and machine learning enthusiasts. 24 fresh talks covering the latest in Python data tools and techniques.

ESC
↑↓ select · ↵ open175 issues