@@ -5,7 +5,7 @@ Function and method signatures
55
66Function signatures in this standard adhere to the following:
77
8- 1. Positional parameters must be `positional-only <https://www.python.org/dev/peps/pep-0570/ >`_ parameters.
8+ 1. Positional parameters should be `positional-only <https://www.python.org/dev/peps/pep-0570/ >`_ parameters.
99 Positional-only parameters have no externally-usable name. When a function
1010 accepting positional-only parameters is called, positional arguments are
1111 mapped to these parameters based solely on their order.
@@ -20,7 +20,7 @@ Function signatures in this standard adhere to the following:
2020 namespace >= 3.8. Alternatively, they can add guidance to their users in the
2121 documentation to use the functions as if they were positional-only.
2222
23- 2. Optional parameters must be `keyword-only <https://www.python.org/dev/peps/pep-3102/ >`_ arguments.
23+ 2. Optional parameters should be `keyword-only <https://www.python.org/dev/peps/pep-3102/ >`_ arguments.
2424
2525 *Rationale: this leads to more readable code, and it makes it easier to
2626 evolve an API over time by adding keywords without having to worry about
@@ -30,8 +30,8 @@ Function signatures in this standard adhere to the following:
3030 is called ``x ``. For functions that have multiple array parameters, those
3131 parameters are called ``xi `` with ``i = 1, 2, ... `` (i.e., ``x1 ``, ``x2 ``).
3232
33- 4. Type annotations are left out of the signatures themselves for readability; however,
34- they are added to individual parameter descriptions. For code which aims to
33+ 4. Signatures include type annotations. The type annotations are also added to
34+ individual parameter and return value descriptions. For code which aims to
3535 adhere to the standard, adding type annotations is strongly recommended.
3636
3737A function signature and description will look like:
@@ -57,3 +57,7 @@ A function signature and description will look like:
5757
5858
5959Method signatures will follow the same conventions modulo the addition of ``self ``.
60+
61+ Note that there are a few exceptions to rules (1) and (2), in cases where
62+ it enhances readability or use of the non-default form of the parameter in
63+ question is commonly used in code written for existing array libraries.
0 commit comments