From ec3a1a8409736e67d895a09db29a8bcb6256f7ad Mon Sep 17 00:00:00 2001 From: Athan Reines Date: Mon, 20 Sep 2021 11:29:22 -0700 Subject: [PATCH 1/2] Specify `__eq__` --- spec/API_specification/data_types.md | 43 +++++++++++++++++++++++++--- 1 file changed, 39 insertions(+), 4 deletions(-) diff --git a/spec/API_specification/data_types.md b/spec/API_specification/data_types.md index 37f528c7a..c295e6804 100644 --- a/spec/API_specification/data_types.md +++ b/spec/API_specification/data_types.md @@ -64,14 +64,49 @@ for more details. ::: ```{note} -Data types ("dtypes") are objects that can be used as `dtype` specifiers in functions and methods (e.g., `zeros((2, 3), dtype=float32)`). A conforming implementation may add methods or attributes to data type objects; however, these methods and attributes are not included in this specification. +A conforming implementation of the array API standard may provide and support additional data types beyond those described in this specification. +``` -Implementations may provide other ways to specify data types (e.g., -`zeros((2, 3), dtype='f4')`); however, these are not included in this specification. +(data-type-objects)= +## Data Type Objects -A conforming implementation of the array API standard may provide and support additional data types beyond those described in this specification. +Data types ("dtypes") are objects which are used as `dtype` specifiers in functions and methods (e.g., `zeros((2, 3), dtype=float32)`). + +```{note} +A conforming implementation may add additional methods or attributes to data type objects beyond those described in this specification. ``` +```{note} +Implementations may provide other ways to specify data types (e.g., `zeros((2, 3), dtype='f4')`) which are not described in this specification; however, in order to ensure portability, array library consumers are recommended to use data type objects as provided by specification conforming array libraries. +``` + +A conforming implementation of the array API standard must provide and support data type objects having the following attributes and methods. + +### Methods + + + +(method-__eq__)= +### \_\_eq\_\_(self, other, /) + +Computes the truth value of `self == other` in order to test for data type object equality. + +#### Parameters + +- **self**: _<dtype>_ + + - data type instance. May be any supported data type. + +- **other**: _<dtype>_ + + - other data type instance. May be any supported data type. + +#### Returns + +- **out**: _<bool>_ + + - a boolean indicating whether the data type objects are equal. + (data-type-defaults)= ## Default Data Types From 862a9105eec34fcf7fe0a0bdbc95def8b0fa8a8f Mon Sep 17 00:00:00 2001 From: Athan Reines Date: Mon, 20 Sep 2021 11:32:14 -0700 Subject: [PATCH 2/2] Fix reference --- spec/API_specification/data_types.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/API_specification/data_types.md b/spec/API_specification/data_types.md index c295e6804..7e295da1e 100644 --- a/spec/API_specification/data_types.md +++ b/spec/API_specification/data_types.md @@ -86,7 +86,7 @@ A conforming implementation of the array API standard must provide and support d -(method-__eq__)= +(data-type-method-__eq__)= ### \_\_eq\_\_(self, other, /) Computes the truth value of `self == other` in order to test for data type object equality.