Please refrain yourself from raising Exception in Python. It doesn’t matter if ChatGPT or Claude says it’s okay to do it, it’s almost always a very bad idea.
Second and last part of the series tackling IEEE-754 floating-point arithmetic with Python. In this post we’re looking at how Python’s standard library Decimal and Fractions modules can help dealing with floating-point gotchas seen in the previous part.
First of a two parts series illustrating common gotchas in IEEE-754 floating-point arithmetic, with practical and realistic examples using Python’s built-in float (double-precision)
The Interwebs are full of recipes on how to capture and stream the output of a Python subprocess in real-time. Most of them don’t work, so here’s how to do it (with Python 3)