@@ -141,48 +141,6 @@ def _np_dtype(dtype: DType | None) -> np.dtype[Any] | None:
141141
142142_real_to_complex_map = {float32 : complex64 , float64 : complex128 }
143143
144-
145-
146-
147- '''
148- _kind_to_dtypes = {
149- None: {x._canonic_name:x for x in _all_dtypes},
150- "bool": {"bool": bool},
151- "signed integer": {x._canonic_name: x for x in _signed_integer_dtypes},
152- "unsigned integer": {x._canonic_name: x for x in _unsigned_integer_dtypes},
153- "integral": {x._canonic_name: x for x in _integer_dtypes},
154- "real floating": {x._canonic_name: x for x in _real_floating_dtypes},
155- "complex floating": {x._canonic_name: x for x in _complex_floating_dtypes},
156- "numeric": {x._canonic_name: x for x in _numeric_dtypes}
157- }
158- '''
159-
160- '''
161- def _kind_to_dtypes(kind : str | None = None) -> dict[str, ...]:
162- """A helper for Device / _info.dtypes().
163-
164- The `kind`s here are those _info.dtypes() accepts. Which differs from
165- "categories" above, yes.
166- """
167- if kind is None:
168- return {x._canonic_name:x for x in dt._all_dtypes}
169- if kind == "bool":
170- return {"bool": dt.bool}
171- if kind == "signed integer":
172- return {x._canonic_name: x for x in dt._signed_integer_dtypes}
173- if kind == "unsigned integer":
174- return {x._canonic_name: x for x in dt._unsigned_integer_dtypes}
175- if kind == "integral":
176- return {x._canonic_name: x for x in dt._integer_dtypes}
177- if kind == "real floating":
178- return {x._canonic_name: x for x in dt._real_floating_dtypes}
179- if kind == "complex floating":
180- return {x._canonic_name: x for x in dt._complex_floating_dtypes}
181- if kind == "numeric":
182- return {x._canonic_name: x for x in dt._numeric_dtypes}
183- raise ValueError(f"unsupported kind: {kind!r}")
184- '''
185-
186144# Note: the spec defines a restricted type promotion table compared to NumPy.
187145# In particular, cross-kind promotions like integer + float or boolean +
188146# integer are not allowed, even for functions that accept both kinds.
0 commit comments