Cleanup vartypes.
@@ -11,25 +11,33 @@ primitive_types = Union[int_types, float_types, bool_types, np.generic]
shape_types = Iterable[primitive_types]
-# static Tensor arg types
-# some primitive static types are merged because mypy thinks bool is a subtype of int and int is a subtype of float
-# see : https://github.com/python/mypy/issues/1850
+'''
+Tensor arg types
+'''
pandas_types = Union[Series, DataFrame]
numpy_types = Union[np.ndarray]
pandas_and_numpy_types = Union[pandas_types, numpy_types]
-tensor_arg_types = Union[int_types, bool_types, float_types, pandas_and_numpy_types]
+# mypy treats bool as a subtype of int and int as a subtype of float
+# see : https://github.com/python/mypy/issues/1850
+tensor_arg_types = Union[primitive_types, pandas_and_numpy_types]
bool_tensor_arg_types = Union[bool_types, pandas_and_numpy_types]
int_and_bool_tensor_arg_types = Union[int_types, bool_types, pandas_and_numpy_types]
-# static Vertex arg types
-# some primitive static types are merged because mypy thinks bool is a subtype of int and int is a subtype of float
-# see : https://github.com/python/mypy/issues/1850
+'''
+Vertex arg types
+'''
vertex_operable_types = Union[VertexOps]
+
+# mypy treats bool as a subtype of int and int as a subtype of float
+# see : https://github.com/python/mypy/issues/1850
vertex_arg_types = Union[tensor_arg_types, vertex_operable_types]
bool_vertex_arg_types = Union[bool_tensor_arg_types, vertex_operable_types]
int_and_bool_vertex_arg_types = Union[int_and_bool_tensor_arg_types, vertex_operable_types]
+'''
+Runtime types
+'''
# mypy prohibits use of static types from typing module at runtime
# see : https://github.com/python/mypy/issues/5354
runtime_numpy_types : Type[Any]
