Python Type Hinting

In Python 3.5 and greater an “optional type hinting syntax” was added. This is part of a gradual typing implementation (gradual typing is essentially adding a few types to an untyped codebase, or only partially typing the codebase as you go). This is the second post in a multi-part series …

The Good, the Bad, and the Ugly of Tuple Unpacking

Python has this neat feature of unpacking tuples during item assignment. Here’s a general example:

or if you have a function that returns multiple items:

But what if (for some reason) you have a function that returns some large number of variables (or a smaller number of long-named …

Solving Political Boundaries Through Simulation

In this writeup we’ll discuss two algorithms, simulated annealing and genetic algorithms, and show how they can be applied to the problem of drawing political boundaries while avoiding gerrymandering. This writeup is available on GitHub, or my personal website. Slides for this post are also available here Table of Contents …