Skip to content

Commit 4673f73

Browse files
committed
Update types.rst again
1 parent e4266dc commit 4673f73

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

docs/source/contributing/docs/types.rst

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,14 @@ same happens with :class:`~.Point2D`, :class:`~.Point2D_Array` and
5858

5959
The rule for typing functions is: **make parameter types as broad as possible,
6060
and return types as specific as possible.** Therefore, for functions which are
61-
intended to be called by users, we should always, if possible, accept ``Like``
62-
types as parameters and return NumPy, non-``Like`` types. The last function,
63-
``shift_point_up()``, is an example of it. Internal functions which are *not*
64-
meant to be called by users may accept non-``Like`` parameters if necessary.
61+
intended to be called by users, **we should always, if possible, accept ``Like``
62+
types as parameters and return NumPy, non-``Like`` types.** The main reason is to
63+
be more flexible with users who might want to pass tuples or lists as arguments
64+
rather than NumPy arrays, because it's more convenient. The last function,
65+
``shift_point_up()``, is an example of it.
66+
67+
Internal functions which are *not* meant to be called by users may accept
68+
non-``Like`` parameters if necessary.
6569

6670
Vectors
6771
~~~~~~~

0 commit comments

Comments
 (0)