Skip to content

Commit 73c7fcb

Browse files
authored
Apply suggestions from code review
1 parent dc5e56d commit 73c7fcb

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

spec/draft/design_topics/exceptions.rst

+6-6
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,23 @@ Exceptions
55

66
This standard specifies expected syntax and semantics for a set of APIs. When
77
inputs to an API do not match what is expected, libraries may emit warnings,
8-
raise exceptions, or misbehave in unexpected ways. In general it is not
8+
raise exceptions, or misbehave in unexpected ways. In general, it is not
99
possible to foresee or specify all the ways in which unexpected or invalid
1010
inputs are provided. Therefore, this standard does not attempt to specify
1111
exception or warning types to the extent needed in order to do exception
1212
handling in a portable manner. In general, it is expected that array library
1313
implementers follow `the guidance given by the documentation of the Python
14-
language <https://docs.python.org/3/library/exceptions.html>`__, and use either
15-
fitting builtin exception or warning types that are appropriate for the
16-
situation, or custom exceptions or warnings that derive from those builtin
14+
language <https://docs.python.org/3/library/exceptions.html>`__, and either use
15+
builtin exception or warning types that are appropriate for the
16+
situation or use custom exceptions or warnings that derive from those builtin
1717
ones.
1818

1919
In specific cases, it may be useful to provide guidance to array library
2020
authors regarding what an appropriate exception is. That guidance will be
2121
phrased as *should* rather than *must* (typically in a *Raises* section),
2222
because (a) there may be reasons for an implementer to deviate, and (b) more
23-
often than not existing array library implementation already differ in their
24-
choices and it may not be worth them breaking backwards compatibility in order
23+
often than not, existing array library implementation already differ in their
24+
choices, and it may not be worth them breaking backward compatibility in order
2525
to comply with a "must" in this standard.
2626

2727
In other cases, this standard will only specify that an exception should or

src/array_api_stubs/_draft/manipulation_functions.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ def reshape(
130130
shape: Tuple[int, ...]
131131
a new shape compatible with the original shape. One shape dimension is allowed to be ``-1``. When a shape dimension is ``-1``, the corresponding output array shape dimension must be inferred from the length of the array and the remaining dimensions.
132132
copy: Optional[bool]
133-
whether or not to copy the input array. If ``True``, the function must always copy. If ``False``, the function must never copy. If ``None``, the function must avoid copying if possible, and may copy otherwise. Default: ``None``.
133+
whether or not to copy the input array. If ``True``, the function must always copy. If ``False``, the function must never copy. If ``None``, the function must avoid copying, if possible, and may copy otherwise. Default: ``None``.
134134
135135
Returns
136136
-------
@@ -190,8 +190,8 @@ def squeeze(x: array, /, axis: Union[int, Tuple[int, ...]]) -> array:
190190
Raises
191191
------
192192
ValueError
193-
If a specified axis has a size greater than one, i.e. it is not a
194-
singleton dimension, a ``ValueError`` should be raised.
193+
If a specified axis has a size greater than one (i.e., it is not a
194+
singleton dimension), a ``ValueError`` should be raised.
195195
"""
196196

197197

0 commit comments

Comments
 (0)