Being really picky, this code isn't PEP8-compliant, it's missing a couple of blank lines.
...my fault for not adding PEP8 checks in the Travis build ;)