from .. import int8, int16, int32, int64, uint8, uint16, uint32, uint64, float32, float64
# Note: This name is changed
from .. import bool_ as bool

_all_dtypes = [int8, int16, int32, int64, uint8, uint16, uint32, uint64,
               float32, float64, bool]
_boolean_dtypes = [bool]
_floating_dtypes = [float32, float64]
_integer_dtypes = [int8, int16, int32, int64, uint8, uint16, uint32, uint64]
_integer_or_boolean_dtypes = [bool, int8, int16, int32, int64, uint8, uint16, uint32, uint64]
_numeric_dtypes = [float32, float64, int8, int16, int32, int64, uint8, uint16, uint32, uint64]

import numpy as np

# Note: we use dtype objects instead of dtype classes. The spec does not
# require any behavior on dtypes other than equality.
int8 = np.dtype('int8')
int16 = np.dtype('int16')
int32 = np.dtype('int32')
int64 = np.dtype('int64')
uint8 = np.dtype('uint8')
uint16 = np.dtype('uint16')
uint32 = np.dtype('uint32')
uint64 = np.dtype('uint64')
float32 = np.dtype('float32')
float64 = np.dtype('float64')
# Note: This name is changed
bool = np.dtype('bool')

_all_dtypes = [int8, int16, int32, int64, uint8, uint16, uint32, uint64,
               float32, float64, bool]
_boolean_dtypes = [bool]
_floating_dtypes = [float32, float64]
_integer_dtypes = [int8, int16, int32, int64, uint8, uint16, uint32, uint64]
_integer_or_boolean_dtypes = [bool, int8, int16, int32, int64, uint8, uint16, uint32, uint64]
_numeric_dtypes = [float32, float64, int8, int16, int32, int64, uint8, uint16, uint32, uint64]

Use dtype objects instead of classes in the array API
Use dtype objects instead of classes in the array API

The array API does not require any methods or behaviors on dtype objects,
other than that they be literals that can be compared for equality and passed
to dtype keywords in functions. Since dtype objects are already used by the
dtype attribute of ndarray, this makes it consistent, so that
func(dtype=<dtype>).dtype will give exactly <dtype> back, which will be the
same thing as numpy._array_api.<dtype>. This also fixes an issue in the array
API test suite due to the fact that dtype classes and objects are not equal as
dictionary keys.
