Welcome to Brad’s Python Notes (PyNotes!).
This blog is a collaboration between me, the python documentation and my Claude Code pair-writer/programmer who is helping me with drafting the original outline for each post. After that I can extend, adjust and tweak the posts to build a much more diverse and comprehensive blog than I would otherwise have time or energy to build.
Recent posts
PEP 485 introduced math.isclose()
to solve the fundamental problem of comparing floating-point numbers by testing if two values are “approximately equal” rather than exactly equal.
A compilation of the most fascinating “Interesting!” facts from my Python blog posts to date, spotlighting three and then building some collections of other interesting features.
The gzip module provides seamless compression and decompression of files using the gzip format, reducing file sizes by 60-90% while maintaining a simple interface compatible with standard file operations.
PEP 465 introduced the @ operator for matrix multiplication, solving a major readability problem in scientific Python code by providing a dedicated operator that makes mathematical formulas translate directly into code.
The textwrap module provides functions for formatting text blocks with intelligent line wrapping, indentation control, and paragraph formatting - perfect for creating clean output, documentation, and user interfaces.
PEP 544 introduces Protocol classes that enable structural subtyping (static duck typing) - type checking based on what methods an object has rather than its inheritance hierarchy, making Python’s type system more flexible and duck-typing friendly.
The struct module converts between Python values and C structs represented as bytes objects, enabling binary data processing for network protocols, file formats, and hardware communication with precise control over byte layout.
The tempfile module creates secure temporary files and directories with automatic cleanup, preventing race conditions and ensuring cross-platform compatibility for safe temporary data handling.
The timeit module provides precise execution time measurement for small code snippets, automatically handling timing complexities and providing both programmatic and command-line interfaces for performance benchmarking.
The decimal module provides exact decimal arithmetic without floating-point precision errors, essential for financial calculations, scientific computing, and any application requiring precise decimal representation.