Recent Posts

Python: MyPy variable annotations

less than 1 minute read

In Python 3.6, variables (in global, class or local scope) can now have type annotations using either of the following two forms:

Python: Mutable default arguments

1 minute read

One of the most confusing moments for new developers is when they discover how Python treats default arguments in function definitions.

Python: Lambdas as lexical closures

less than 1 minute read

A ‘lexical closure’ is a fancy name for a function that remembers the values from the enclosing lexical scope even when the program flow is no longer in that...

Python: Parallel for loops

1 minute read

Joblib provides a simple helper class to write parallel for loops using multiprocessing. The core idea is to write the code to be executed as a generator ...