Python3 doesn't like `if [x = ...]` inline assignment trickery (kwargs out of scope).