PythonHub
2.44K subscribers
2.35K photos
49.4K links
News & links about Python programming.
https://pythonhub.dev/
Download Telegram
Python Singleton Pattern: Smarter Than You Think?

This video analyzes the strengths and weaknesses of the singleton pattern in Python, explaining why global state is risky but controlled instantiation can be valuable in certain cases. It recommends module-level singletons and thread safety measures, while cautioning against tight coupling and testing pitfalls with traditional singleton implementations.

https://www.youtube.com/watch?v=p_UQ7tzUFLo
LLMs from Scratch – Practical Engineering from Base Model to PPO RLHF

This video provides a hands-on guide to building a large language model entirely from scratch in PyTorch, covering every step from core transformer design to advanced alignment with RLHF. By the end, viewers gain practical experience in implementing, training, scaling, and aligning their own custom LLMs.

https://www.youtube.com/watch?v=p3sij8QzONQ
Unlocking Performance in Python's Free-Threaded Future: GC Optimizations

A description of the performance optimizations made to the free-threaded garbage collector for Python 3.14.

https://labs.quansight.org/blog/free-threaded-gc-3-14
DuckDB vs Polars. Wait. DuckDB and Polars.

The article emphasizes that DuckDB and Polars are not direct competitors but complementary tools in the Modern Data Stack, with each excelling in different contexts: DuckDB is best for SQL-heavy analytics and embedding as a query engine, while Polars suits end-to-end ETL pipelines and DataFrame-centric workflows. The choice depends on your problem context, team comfort, and use case rath...

https://www.confessionsofadataguy.com/duckdb-vs-polars-wait-duckdb-and-polars/
Simplifying Resource Management in mssql-python through Context Manager

The article introduces context manager support in the mssql-python driver, allowing Python applications to manage SQL Server and Azure SQL resources more safely and efficiently using Python's "with" statement. This feature automates opening and closing of connections and cursors, as well as commit and rollback of transactions, reducing boilerplate code, preventing resource leaks, and ens...

https://devblogs.microsoft.com/python/simplifying-resource-management-in-mssql-python-through-context-manager/
Effective context engineering for AI agents

Context is a critical but finite resource for AI agents. In this post, we explore strategies for effectively curating and managing the context that powers them.

https://www.anthropic.com/engineering/effective-context-engineering-for-ai-agents