diff options
author | Stephan Hoyer <shoyer@google.com> | 2018-11-10 16:46:55 -0800 |
---|---|---|
committer | Stephan Hoyer <shoyer@google.com> | 2018-11-10 16:46:55 -0800 |
commit | 42eaf9a60064bfb2162995415b9f0f7cb24886f9 (patch) | |
tree | 5aff8cff817bbf0b478a3902abdeceada2e6ed72 /doc | |
parent | d0e2f1ac0c0fb4aaf791c9082cff1d6b04545410 (diff) | |
download | numpy-42eaf9a60064bfb2162995415b9f0f7cb24886f9.tar.gz |
NEP: clarify the purpose of "types" in __array_function__
Per our discussion on the mailing list:
https://mail.python.org/pipermail/numpy-discussion/2018-November/078911.html
Diffstat (limited to 'doc')
-rw-r--r-- | doc/neps/nep-0018-array-function-protocol.rst | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/doc/neps/nep-0018-array-function-protocol.rst b/doc/neps/nep-0018-array-function-protocol.rst index 75f4132a4..f558e60f2 100644 --- a/doc/neps/nep-0018-array-function-protocol.rst +++ b/doc/neps/nep-0018-array-function-protocol.rst @@ -119,8 +119,9 @@ implementing the array API. As a convenience for ``__array_function__`` implementors, ``types`` provides all argument types with an ``'__array_function__'`` attribute. This -allows downstream implementations to quickly determine if they are likely able -to support the operation. The type of ``types`` is intentionally vague: +allows implementors to quickly identify cases where they should defer to +``__array_function__`` implementations on other arguments. +The type of ``types`` is intentionally vague: ``frozenset`` would most closely match intended use, but we may use ``tuple`` instead for performance reasons. In any case, ``__array_function__`` implementations should not rely on the iteration order of ``types``, which |