Library
28 posts
Deduplicating the Result Is Not Deduplicating the Work
A graph walk that collects into a set returns correct output while still enumerating every path. Why a visited set and an accumulator are two different things.
How Date Inference Works, and Why Ambiguity Is the Problem
Guessing a strptime format from examples is a scoring problem with ties. The dangerous outputs are the wrong guesses that still parse cleanly.
Cache Keys Must Come From the Resolved Call
A memoization decorator that reads kwargs cannot see positional arguments, so distinct calls collide. How to build keys from the bound signature instead.
Handling Deprecation: Gracefully Retiring Features
Learn to deprecate Python library features gracefully with warnings, clear communication, and migration paths that minimize disruption to your users.
Python Logging Best Practices for Library Developers
A comprehensive guide to implementing logging in Python libraries - from basic setup to advanced patterns and common pitfalls to avoid
Documenting Your Library's API: Best Practices
Build a clear, comprehensive API reference with Sphinx & autodoc. Learn best practices for structure, content, cross-referencing your Python library docs.
Automating Docs Deployment with GitHub Actions and Pages
Keep docs current automatically! Learn to set up GitHub Actions to build Sphinx docs & deploy to GitHub Pages, ensuring sync with your code changes.
Crafting Code Examples: From Snippets to Real-World Scenarios
Master the art of crafting clear, runnable code examples for documentation using doctest, tutorials, and scripts to enhance user understanding.
Getting Started with Sphinx for Python Project Documentation
Learn how to use Sphinx to generate professional, cross-referenced documentation for your Python projects, covering installation, configuration, and autodoc.
Effective Docstrings: Google vs. NumPy vs. reStructuredText Styles
Learn to write clear docstrings Sphinx understands. Compares Google, NumPy, and reStructuredText formats for effective Python library documentation.