Using a game leaderboard as an example, this article dives deep into the singleton pattern concept and implementation, with a focus on the clever technique of using the __new__() method for object creation. While the singleton pattern is commonly used in other languages, Python offers more elegant alternatives—since modules themselves are natural singletons, using global variables and functions is often more graceful.
TL;DR
A hands-on guide to Python 3.14's free-threading shows how to kill the GIL in practice, while the singleton pattern gets a well-earned takedown; Tencent's Hunyuan3D and the AP2 agent payments protocol lead the AI pack.
Articles & Tutorials
× 12A comprehensive exploration of Python's weak reference mechanism in memory management, starting from the fundamentals of reference counting and analyzing how circular references lead to memory leaks. Through linked list node examples, it demonstrates the difference between strong and weak references, explaining how weak references can reference objects without preventing garbage collection—particularly useful for caching and subscriber list scenarios.
This article introduces how to leverage wrapt 2.0.0's new LazyObjectProxy feature for lazy module imports, implementing the PEP-810 proposal shared in a previous issue. Unlike traditional approaches, it doesn't modify the global sys.modules, only affecting the scope where lazy imports are used, avoiding global side effects.
An in-depth analysis of compatibility issues between Django 5.1 connection pooling and Celery async tasks, providing detailed explanations of Django ORM async call mechanisms. It reveals how sync_to_async uses global thread executors leading to connection leaks, and offers a complete solution based on ThreadSensitiveContext, including custom @async_task decorators and prefork mode handling strategies.
Python 3.14 removes the GIL to achieve true multithreaded parallelism. This article analyzes the historical reasons for the GIL, limitations of traditional concurrency models, and provides detailed compilation guides and performance testing. Through N-Queens benchmarks, it demonstrates an 8x performance boost on M1 Pro, while explaining considerations for C extension recompilation and thread safety.
Customize your Python 3.13+ REPL experience through PYTHONSTARTUP files and the pyrepl-hacks library. The article shows how to add custom keyboard shortcuts, syntax highlighting themes, and convenient code editing features, making the REPL feel more like a modern editor.
A deep dive into security vulnerabilities and attack methods across different Python UUID versions, detailing the generation logic of UUIDv1-v8, revealing security differences between PRNG and CSPRNG, introducing practical attack techniques like Sandwich Attack, and providing comprehensive attack workflows and protection recommendations.
GitHub Actions now supports experimental free-threaded CPython testing. The article covers three configuration methods: using the 't' suffix, setup-uv, and freethreaded variables, providing complete CI configuration examples and environment variable setup.
Challenging conventional wisdom, this article demonstrates how to build a complete REST API using only Django's built-in features. The author cleverly implements serialization through JsonViewMixin and ModelForm, combined with generic class views for CRUD operations, proving that DRF isn't always necessary for elegant API functionality in simple scenarios.
Introducing an innovative technical solution that allows Python ASGI applications to run directly within Node.js processes. Through a Rust-built bridge layer, it achieves zero network overhead in-process communication without needing separate Python processes or network connections. This architecture is particularly suited for low-latency AI/ML application scenarios while supporting mainstream Python frameworks like FastAPI and Django.
How is AI technology revolutionizing API testing workflows? This article introduces EchoAPI, which supports natural language descriptions of testing requirements to automatically generate executable scripts and assertions, intelligently analyzes API response structures, automatically creates test cases covering edge cases, and generates dynamic variables and mock data.
While developing a time tracking application, the author discovered a common pitfall with timedelta objects: using only the seconds attribute when calculating durations across days yields incorrect results. The article explains in detail how Python normalizes time differences into three attributes—days, seconds, and microseconds—revealing why you need to use the total_seconds() method or manually calculate (days * 24) + (seconds / 3600) to get accurate hour counts.
Projects & Resources
× 12A privacy-focused browser built on Chromium with Google components removed, featuring optimal privacy settings and ad blocking by default. Supports split-screen browsing and tab group management, compatible with macOS, Linux, and Windows. (5K stars)
A terminal-based cron job management tool built with Textual, supporting both local and remote servers. Provides task creation, editing, deletion, and pause functionality with SSH connection support and server bookmarks.
Developed by the National University of Singapore, this tool converts LaTeX papers into complete presentation videos. Integrates slide creation, speech synthesis, and virtual presenter features, supporting GPT-4 and Gemini. (1K stars)
A production-ready template collection featuring best practice templates for Docker, Terraform, Ansible, Kubernetes, and more. Includes CLI tools for rapid project structure generation. (6.8K stars)
A security research tool for scanning OpenAI API keys on GitHub, using Selenium and regex for deep searching with results stored in SQLite database. Intended for security research purposes only.
A 6-month real trading experiment where ChatGPT manages a micro-cap stock portfolio. Features trading engine, portfolio management, automated stop-loss, and provides transparent performance tracking with visualization analytics. (6.5K stars)
Harvard University's open-source machine learning systems textbook covering the complete tech stack from edge devices to cloud deployment. Offers online reading, PDF format, and TinyTorch educational framework. (3.4K stars)
ByteDance's Volcano Engine context-aware AI agent that understands users' digital world through screenshots. Features local-first privacy protection and compatibility with Doubao, OpenAI, and other model services. (1.8K stars)
A Chinese financial trading framework based on multi-agent large language models, supporting A-share, Hong Kong, and US stock analysis. Integrates multiple LLMs and provides intelligent news analysis with Docker deployment. (10.8K stars)
Google's AI agent payment protocol featuring dual verification mechanisms to ensure secure agent purchases on behalf of users. Supports both traditional payments and cryptocurrency transactions. (2.3K stars)
Tencent's first production-grade 3D asset generation model that creates high-fidelity 3D models from images using PBR material synthesis technology. Fully open-sourced model weights and training code. (2.3K stars)
An AI engineering resource library optimized for Claude Code, providing Product Requirements Prompts (PRP) methodology with 12 pre-configured commands and complete template systems for production-ready code generation by AI agents. (1.7K stars)