Also `type` is a built in type in Python/Cython. It probably should not be used as local variable name.