From 044c07716a808edd66a0c64b10d7f7f4c081458f Mon Sep 17 00:00:00 2001 From: Sebastian Berg Date: Fri, 2 Dec 2022 12:23:09 +0100 Subject: DOC: No need to repeat "error" after DTypePromotionError and line breaks --- numpy/exceptions.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'numpy/exceptions.py') diff --git a/numpy/exceptions.py b/numpy/exceptions.py index c477f0334..721b8102e 100644 --- a/numpy/exceptions.py +++ b/numpy/exceptions.py @@ -208,10 +208,10 @@ class DTypePromotionError(TypeError): Notes ----- - ``DTypePromotionError`` derives from ``TypeError``. Many functions will - use promotion to find the correct result and implementation. - For these functions the error will be chained with a more specific error - indicating that no implementation was found for the input dtypes. + Many functions will use promotion to find the correct result and + implementation. For these functions the error will typically be chained + with a more specific error indicating that no implementation was found + for the input dtypes. Typically promotion should be considered "invalid" between the dtypes of two arrays when `arr1 == arr2` can safely return all ``False`` because the @@ -223,14 +223,14 @@ class DTypePromotionError(TypeError): promoted: >>> np.result_type(np.dtype("M8[s]"), np.complex128) - DTypePromotionError: The DType could not be - promoted by . This means that no common + DTypePromotionError: The DType could not + be promoted by . This means that no common DType exists for the given inputs. For example they cannot be stored in a single array unless the dtype is `object`. The full list of DTypes is: (, ) For example for structured dtypes, the structure can mismatch and the - same ``DTypePromotionError`` error is given when two structured dtypes with + same ``DTypePromotionError`` is given when two structured dtypes with a mismatch in their number of fields is given: >>> dtype1 = np.dtype([("field1", np.float64), ("field2", np.int64)]) -- cgit v1.2.1