Planet Python

The website Planet Python is a planet site that aggregates Python-related content from various sources, including blogs, news sites, and other online publications. The website provides a one-stop destination for individuals to stay up-to-date with the latest developments in the Python programming world. The content on the site includes tutorials, news, project announcements, and discussions about various Python-related topics. Users can visit the site to stay informed about the Python community, new releases, conferences, and best practices in using the Python programming language. The website's purpose is to help promote and disseminate Python-related content, thereby contributing to the growth and development of the Python community.

Thread Of Notes

Anger at work is generally unproductive and creates a negative environment for colleagues. Discovering a shared vision within a company and aligning with it, or accepting it if disagreement exists and change isn't possible, is crucial. A prevalent question in the tech industry is how to avoid anger amidst rapid changes, particularly concerning AI. The author suggests that feelings of disorientation and anxiety are more appropriate responses than anger. Anxiety acknowledges uncertainty about the future without assigning blame. Anger, however, requires a target and implies external wrongdoing. While AI may bring productivity gains, there's concern these will benefit companies over employees. Many tech leaders express doubts about AI, worried about costs and competition from large AI labs. Instead of anger, the author proposes embracing uncertainty, which can foster curiosity and engagement with new developments. Genuine excitement is another alternative, leading to a sense of empowerment and freedom. The author notes that AI's benefits are often seen in personal projects, not just company profits. This shift highlights the uncertainty leaders face, with many projecting confidence despite private doubts. The author experiences this duality of excitement and uncertainty regarding their own profession and business. While anger can feel more actionable by providing a villain, it often misdirects focus during disruptive changes like AI. Although societal, environmental, and global impacts of these changes are concerning, dwelling on anger towards individuals is unproductive. Instead, remaining curious and excited about experimentation is encouraged. This approach will allow for informed decisions about when and where resistance is truly warranted.
CdXz5zHNQW_3HN87m7Gll.png
CdXz5zHNQW_kaNMCAHtWT.webp
Large Language Models (LLMs) are exacerbating an existing crisis within the open-source software community, particularly regarding the volume of code reviews. This pressure extends beyond open-source, impacting the entire computing field. LLMs are fundamentally changing how programming is done, even for those who try to avoid them. Users are employing LLMs to automate extensive code reviews, generating significant compute costs.This automation raises concerns about the potential for API pricing changes, essentially charging for what was previously more accessible. The author, a proponent of free and open-source software, observes a shift towards renting software, mirroring a past era where acquiring tools like compilers was a significant expense. Now, many software tools and LLM access require ongoing monthly payments, leading to a situation where developers must pay to get their work done.This trend is seen as "enshitification," where companies train models on stolen work and then sell it back to developers. Furthermore, LLMs are presented as a threat to engineering jobs, contributing to a deteriorating job market with fewer opportunities and lower pay. Tech companies are perceived as actively attacking the engineering profession by pushing for the use of models they control.Even without mandatory LLM use, the pressure to keep pace with LLM-generated work is immense, potentially compromising supply chain security. The author contends that the LLM hype is part of a broader societal attack on workers and the environment. Addressing this requires collective political and social action, rather than individual adaptation.
CdXz5zHNQW_KvYYV2hcVr.png
Python 3.12.14, 3.11.16, and 3.10.21 have been released as security-fix-only updates. These releases address multiple critical vulnerabilities including tarfile hardening, path-traversal bypasses, and various CVEs related to Python's standard library. Users on these versions, especially those handling untrusted tarballs, are strongly advised to update.Codeberg's recent ban on projects primarily generated by AI is being examined for its implications as a potential GitHub alternative. This policy raises questions about whether code hosting platforms should regulate the creation process of software versus focusing on its behavior and impact. The difficulty in defining and enforcing "mostly generated" code presents a significant challenge to this approach.Brett Cannon has highlighted missing components for achieving reproducible builds on PyPI. Currently, there's no standardized method to record the exact source code a distribution originated from or the specific build tools used. Implementing solutions for these gaps would involve modifying sdist metadata and potentially introducing an sdist version 2.A major focus in reproducible builds is ensuring the integrity of the software supply chain. The goal is to make reproduction a seamless process for creators while empowering build backends and installers with the necessary information. This could lead to PyPI displaying independently reproduced builds, offering enhanced trust for users.Pydantic Logfire is sponsoring the episode, offering observability for AI applications. It provides unified tracing across agents, LLMs, APIs, and databases, down to the infrastructure level. Logfire utilizes OpenTelemetry and allows querying all data with Postgres-compatible SQL.The sponsor emphasizes that even AI applications are fundamentally engineering efforts. They offer a free tier and an easy onboarding process for developers to integrate Logfire into their applications.In other news, uv has transitioned to preferring post-quantum key exchange for enhanced security in its operations. This update reflects a growing trend towards incorporating future-proof cryptographic methods.Other "extra" items include upgrades to MCP servers, syncing agentsview via postgres, new offerings for Talk Python courses, and the release of the "Lean TDD" audiobook. The episode concludes with a brief joke about a dog.
Cal Newport warns that AI-driven speed in coding may erode the critical thinking skills that define good engineering. Instead of actively understanding code, developers risk passive recognition, becoming detached from the foundational understanding. While some advocate for a complete return to manual coding, the author seeks a balanced approach. This middle ground involves intentionally integrating friction, which is crucial for learning and skill development.Skill atrophy occurs not from using AI itself, but from delegating the internal modeling process. The author distinguishes between skill atrophy and AI's potential for generating subtly incorrect code. To maintain ownership and understanding, developers should re-derive complex code paths and ensure they can explain every change. Narrowing AI tasks to well-defined problems helps keep engineers involved and prevents overwhelming code reviews.Corey Schafer's methods, like detailed prompts and thorough code review, offer practical ways to preserve this friction. However, human attention is finite, necessitating automation of the remaining tasks. This is where "correctness by design" becomes vital, employing stricter system-level checks like strong typing and compile-time assertions.Rust exemplifies this by making invalid states unrepresentable, forcing AI compliance. In Python, type checkers and validation models serve a similar purpose. Ultimately, responsible AI use in development requires both retaining control over critical decisions to sharpen judgment and implementing strict rules to ensure AI's accountability. Software engineering remains a process of judgment and experience, with AI automating tedious aspects. The key takeaway is to identify and refuse to delegate the most important decisions to AI, ensuring true ownership and robust code.
The sys module in Python is described as a "junk drawer" holding many miscellaneous items. This article explores what the sys module might look like if designed from scratch today. Currently, sys has over a hundred attributes, many of which are functions, leading to a crowded namespace. To address this, the author proposes reorganizing sys into nine submodules.These proposed submodules include sys.cli for command-line arguments, sys.imports for module-related functions, sys.io for standard input/output, sys.repl for interactive prompt settings, sys.interpreter for system and installation details, sys.memory for memory management tools, sys.exceptions for exception handling, sys.profile for profiling and introspection, and sys.runtime for interpreter behavior. Some attributes within these proposed submodules bear resemblance to existing standard library modules, hinting at potential further reorganization.The article acknowledges the significant challenges of actually implementing such a reorganization. Primarily, the transition period and maintaining backward compatibility for existing code that relies on the current flat namespace of sys present major hurdles. A technical solution involving module-level attribute handling is discussed, demonstrating how the old flat namespace could be preserved for compatibility. However, the author doubts this reorganization will ever happen due to the vast amount of existing code and the Python community's general reluctance to make such foundational changes unless absolutely necessary. The main takeaway for developers is that submodules can be a useful organizational tool for large "utils" modules.
Traditional AI agents struggle with Jupyter notebooks, often corrupting files and losing model state upon completion. A new Jupyter skill integrated into PyCharm addresses this by allowing AI agents to operate within a live Jupyter kernel. This innovation ensures state persistence across cells, preventing notebook corruption. It also optimizes long jobs by having the agent wait for execution rather than constantly polling. This live kernel approach proved to be approximately 12% cheaper for Claude Opus 5 across twelve machine learning tasks. The cost savings stem from an improved cache-warming mechanism, leading to a higher percentage of cache reads. Previously, AI tools treated notebooks as plain text, leading to corruption and loss of critical runtime information when using subprocesses. The new Jupyter skill leverages PyCharm's internal notebook intelligence to provide the agent with direct kernel control. This allows agents to write and run Python code directly, maintaining variables and trained models. The skill also implements a more efficient waiting mechanism and reads only new output, reducing token waste. While cost savings are evident, especially for stateful jobs, the skill also offers workflow improvements for other models. Users are reminded to explicitly instruct agents to save their work. Complex ML tasks may still require human intervention, as the skill addresses tooling inefficiencies, not fundamental ML difficulty. This functionality is available with a JetBrains AI subscription.
CdXz5zHNQW_14ZOYttUhz.png
CdXz5zHNQW_IFrCzZRuFh.png
A company is developing an AI test framework for Postgres AI Hybrid Manager, a product that integrates traditional Postgres management with AI tools like Langflow. This chatbot aims to unify product features, help documentation, and AI workflows into a single conversational interface. Testing such an LLM-backed agent is challenging because its responses are non-deterministic and can be subtly wrong even when fluent. The framework evolved to address this by focusing on testing the entire chat trajectory, not just final answers.Key concepts are introduced, including "Goldens" (perfect desired outputs) and "Rubrics" (qualitative checklists for good answers). For AI testing, LLMs are used as judges to score outputs against Goldens or Rubrics, translating complex responses into pass/fail results. Task Completion Rate (TCR) is used to aggregate multiple eval passes. The testing strategy began with simple routing evals, checking if the chatbot directed prompts to the correct specialized agent or skill.As the system evolved from agents per tool to a consolidated orchestrating agent with skills, routing evals adapted to check for the visibility and selection of the right skill. Subsequently, TCR evals were implemented to assess if the chatbot's full response successfully completed the user's task, using LLM-as-a-judge with specific rubrics. This led to two execution modes: Direct mode for prompt and rubric development, and Proxy mode to test the full production path.The framework also had to handle multi-step conversations, where the test unit became the entire conversation, not just single turns. This required preserving conversation state across multiple API calls in Proxy mode or simulating it in Direct mode. Scoring now includes per-step checks and an overall conversation score. The underlying testing library used is deepeval, upon which the company built its pipeline, plugin system, CI integration, and Langfuse push. Routing is implemented as a custom BaseMetric in deepeval, demonstrating how specific business rules can be integrated into the LLM evaluation process.
CdXz5zHNQW_2wtMsPJlJt.png