Skip to main content

Python

Using a progress bar while multiprocessing in Python

·660 words·4 mins· loading · loading
Spreading out computation is made simple in Python with the built-in multiprocessing module. Yet, it is not immediately obvious how to effectively portray the completion status in a progress bar. In this brief tutorial, I demonstrate how to easily and accurately display the progress of a multiprocessing pool.

Caution when using Python's `Final` type hint on mutable objects.

·689 words·4 mins· loading · loading
In the course of my work, I stumbled across a misconception I had about the Final type annotation. I perceived it to mean that the annotated object should not be mutated. In this post, I demonstrate how this is an incorrect understanding of the Final type hint and a better solution to get help from the type checker in these situations.