Don't use `assert`, it goes away when python is run in release mode. Use `assert_(...)` instead.