diff --git a/python/taichi/lang/__init__.py b/python/taichi/lang/__init__.py index aa0b549b62130..1d3640e66b6c9 100644 --- a/python/taichi/lang/__init__.py +++ b/python/taichi/lang/__init__.py @@ -54,8 +54,7 @@ from taichi.snode.fields_builder import FieldsBuilder from taichi.tools.util import set_gdb_trigger, warning from taichi.types.annotations import any_arr, ext_arr, template -from taichi.types.primitive_types import (f16, f32, f64, i32, i64, - integer_types, u32, u64) +from taichi.types.primitive_types import f16, f32, f64, i32, i64, u32, u64 from taichi import _logging diff --git a/python/taichi/lang/struct.py b/python/taichi/lang/struct.py index a0bfa37814e5d..17964c00afcbf 100644 --- a/python/taichi/lang/struct.py +++ b/python/taichi/lang/struct.py @@ -8,7 +8,7 @@ from taichi.lang.matrix import Matrix from taichi.lang.util import (cook_dtype, in_python_scope, is_taichi_class, python_scope, taichi_scope) -from taichi.types import CompoundType, integer_types +from taichi.types import CompoundType, primitive_types class Struct(TaichiOperations): @@ -494,7 +494,9 @@ def cast(self, struct): else: if in_python_scope(): v = struct.entries[k] - entries[k] = int(v) if dtype in integer_types else float(v) + entries[k] = int( + v + ) if dtype in primitive_types.integer_types else float(v) else: entries[k] = ops.cast(struct.entries[k], dtype) return Struct(entries) diff --git a/python/taichi/types/primitive_types.py b/python/taichi/types/primitive_types.py index 289663f8bf729..58761c7a6ad5c 100644 --- a/python/taichi/types/primitive_types.py +++ b/python/taichi/types/primitive_types.py @@ -90,8 +90,6 @@ 'u32', 'uint64', 'u64', - 'real_types', - 'integer_types', 'is_signed', 'is_integral', ]