Python Development: Tools, Tips, & PEP Updates
Overview of Tools and Practices
In this episode, the hosts dive into several essential tools and evolving standards in the Python ecosystem.
Productivity Enhancements
• Rich-CLI: A powerful command-line tool that enables pretty-printing of files, JSON, and Markdown directly in the terminal with support for themes and syntax highlighting. It now includes built-in paging capabilities.
• Debugger Best Practices: The team discusses the utility of DebugPy and the benefits of using advanced features available in IDEs like VS Code, specifically conditional breakpoints and log points to optimize development cycles.
Documentation and Testing
Efficient software development relies on maintaining high-quality documentation.
• Testing Documentation: The discussion highlights using tests to verify that configuration options and plugins are appropriately documented, as demonstrated by Simon Willison.
• Cog Library: A tool that allows developers to maintain code examples within documentation by generating them dynamically from source, ensuring synchronization and avoiding stale information.
Language Evolution and Ecosystem Updates
Typing and PEPs
"Basically, think of capital S self as the return type for all those class methods you write that construct an instance of your object."
• PEP 673 (Self-Type): This new feature, which was recently accepted, provides a standard, clean way to annotate methods that return an instance of the class in which they are defined.
Project Updates
• Black: The popular formatter has officially exited its beta phase with the release of version 2020.1.0.
• PIP 22: New updates in PIP include improved error output by leveraging parts of Rich, and changes to HTML parsing that occasionally impact legacy project repositories that do not strictly adhere to the HTML5 specification.