Python Trending Weekly
ISSUE 64

Are Function Calls Still Slow in Python?

2024-08-10 Season 3

TL;DR

CPython keeps making function calls faster, PyCon US 2024 recordings are out, Meta releases Segment Anything Model 2, and Bilibili creator Gaotian tells how he became a Python core developer.

Articles 11 Projects 13 Media 1
🦄

Articles & Tutorials

× 11
01 Recent Performance Improvements in Function Calls in CPython blog.codingconfessions.com

What's the performance gap between calling built-in functions versus regular functions in Python? Does converting function calls to inline code provide improvements? What enhancements have been made to function calls since Python 3.10? This article dives deep into bytecode and Python interpreter source code to thoroughly answer performance questions related to function calls.

Is your own code faster than the min function?
02 Log context propagation in Python ASGI apps rednafi.com

In distributed logging, how do you effectively tag logs with contextual information (like user IDs)? Manually passing context information can be cumbersome. This article shows how to develop middleware that automatically records call chain context information in logs, improving code maintainability.

03 PyCon US 2024 Recap and Recording Release pycon.blogspot.com

The official recap of PyCon US 2024 is here! This 18-page report shares attendance numbers, audience demographics, event highlights, and amazing photos.

04 Python API Integration In-Depth Tutorial zato.io

API integration refers to connecting different systems and applications, breaking down data silos, and improving business processes. Zato is a Python-based API and data integration platform. This tutorial provides detailed coverage of its features and usage.

05 Python Monthly Hot Topics Collection (Japanese) gihyo.jp

A collection of 25 articles covering Python hot topics, ranging from Python's new features to popular third-party library introductions (Python in Excel, PyScript, Rust-based Polars, uv), and Python application scenarios (Sphinx documentation deployment, Cloudflare Workers serverless Python code deployment). (Shared by @NoHeartPen)

06 Quickly find the right datetime format code for your date treyhunner.com

The author introduces an online tool they developed that can quickly generate formatted time strings based on your desired date/time description.

07 django-http-debug, a new Django app simonwillison.net

The author developed a new project called django-http-debug that can quickly set up a URL to return fixed HTTP responses and log all request data to a database. The article covers how it works, using Claude for development assistance, and insights on LLM-assisted development.

08 PyTorch Lightning: A Comprehensive Hands-On Tutorial datacamp.com

This tutorial covers how to use PyTorch Lightning for deep learning model development, including environment setup, model training, and practical examples. Perfect for beginners.

09 Python extensions should be lazy gauge.sh

Python's ast module is developed in C, but the author discovered significant memory allocation and garbage collection when interacting with the Python interpreter, causing lengthy execution times. By introducing Rust optimizations, they improved performance from 8.7 seconds to 530 milliseconds.

AST Query Engine Diagram
10 Google Testing Blog: Don't DRY Your Code Prematurely testing.googleblog.com

"Don't Repeat Yourself" (DRY) is a common coding principle, but this article provokes thought: Is duplicate code really redundant? Will they evolve independently? Don't optimize duplicate code prematurely.

11 Essays on programming I think about a lot benkuhn.net

The author shares over 10 programming articles that have been particularly inspiring to them, along with excerpts of key insights. This is almost like a "weekly" of quality article sharing - highly recommended reading.

🐿️

Projects & Resources

× 13
01 zato: ESB, SOA, REST, APIs and Cloud Integrations in Python github.com

Automation, integration, and orchestration for business systems, APIs, workflows, and even hardware assets. (star 1.1K)

02 segment-anything-2: Meta Segment Anything Model 2 github.com

Meta's open-source foundation model for solving promptable visual segmentation in images and videos. (star 9K)

03 alive-progress: A new kind of Progress Bar, with real-time throughput, ETA, and very cool animations! github.com

A cool progress bar library with real-time progress display, efficient multi-threading, accurate ETA, beautiful summaries when finished, pause support, and high customizability. (star 5.3K)

alive-progress: A new kind of Progress Bar, with real-time throughput, ETA, and very cool animations!
04 Ingram: Webcam vulnerability scanning tool github.com

A vulnerability scanning framework for network cameras, currently integrated with common devices like Hikvision, Dahua, Uniview, and D-Link. (star 1.6K)

05 Deep-Live-Cam: real time face swap and one-click video deepfake with only a single image github.com

Achieve face swapping in target images or videos with just a single facial photo! (star 2.9K)

06 annotated_deep_learning_paper_implementations: 60 Deep Learning Paper Implementations/Tutorials with Annotations github.com

A collection of simple PyTorch implementations of neural networks and related algorithms. (star 52.8K)

07 table-transformer: a deep learning model for extracting tables from unstructured documents github.com

An object detection-based deep learning model for extracting tables from PDFs and images. (star 2.1K)

08 wsgidav: A generic and extendable WebDAV server based on WSGI github.com

A WSGI-based WebDAV server that's a high-performance, multi-threaded web server with SSL support, installable and runnable on Linux, OSX, and Windows.

09 silero-vad: pre-trained enterprise-grade Voice Activity Detector github.com

An excellent voice detection tool with JIT models only 2 MB in size, trained on a massive corpus of 6000+ languages, supporting 8000 Hz and 16000 Hz sampling rates. (star 3.6K)

10 textual-serve: Serve Textual apps locally github.com

Start a local Textual server to convert command-line Textual applications into web applications. Unlike textual-web which provides Textual apps on public URLs, this project allows self-hosting.

11 geopandas: Python tools for geographic data github.com

A project that adds geographic data support to pandas objects, implementing GeoSeries and GeoDataFrame types for geometric object operations. (star 4.4K)

12 IMS-Toucan: Multilingual and Controllable Text-to-Speech Toolkit github.com

A toolkit for teaching, training, and using speech synthesis models. Based on pure Python and PyTorch, simple and beginner-friendly. (star 1.3K)

13 beancount: Double-Entry Accounting from Text Files github.com

Define financial transaction records in text files, read them into memory, generate various reports, and provide a web interface. (star 3.6K)

🐢

Podcasts & Videos

× 1
01 Ep 48. Interview with Gaotian: To Become a Good Bilibili UP Master, I Became a Python Core Developer pythonhunter.org

Becoming a Python core developer in just one year - Gaotian is amazing! My takeaway is: spend less time on pure entertainment, dedicate a few hours each week to developing interests, and do something that makes you stand out. This might not achieve any utilitarian goals, but at least it makes life meaningful.

ESC
↑↓ select · ↵ open175 issues