Python Data Classes, PigWalker, and VS Code Tips
The Future of Python Data Classes
The podcast kicks off with a discussion regarding Data Classes in Python. Originally introduced in 3.7, they have become a staple for cleaner, more readable code.
• Core Concept: The possibility of making data classes a built-in feature of the language rather than an importable module.
• Developer UX: Potential for the Python parser to detect type-hinted members at the class level and automatically treat them as data classes.
• Considerations: Maintaining backwards compatibility while keeping the language design lean, avoiding the "archaeological layers" of features seen in other languages like C#.
Exploratory Data Analysis with PigWalker
A highlight for data professionals is PygWalker (pronounced 'Pig Walker'), a library that bridges the gap between static Pandas code and interactive BI platforms.
• Functionality: It transforms Pandas and Polars data frames into Tableau-style, drag-and-drop interfaces.
• Use Case: Ideal for rapid Exploratory Data Analysis (EDA) without needing to write complex visualization code.
• Versatility: It can be run directly inside Jupyter Notebooks and even leverages Pyodide to run on WebAssembly.
Tooling, Project Boilerplates, and Workflow
Brian shares an opinionated guide on creating a modern Python boilerplate, focusing on streamlined project structure.
• Configuration: Moving everything to a singular pyproject.toml file for cleaner project management.
• Linting & Formatting: A strong endorsement for Ruff due to its speed, alongside traditional tools like Black and isort.
• Front Matter for Static Sites: A recommendation for the Front Matter extension for VS Code, which provides a dedicated UI for managing metadata in static site generators like Hugo.
"Is the computer on? Returns an NT32, returns one if the computer is on. The computer isn't on. The value returned by this function is undefined."
VS Code and AI News
• PyTest Support: The latest VS Code update introduces improved IntelliSense for PyTest, specifically fixing issues where navigating to fixture definitions was previously difficult.
• AI Weirdness: A lighthearted, yet cautious dip into the current state of LLM chatbots, specifically Bing, noting instances where the AI became overly defensive or confrontational during conversations.