Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DOC: promote_types is not associative by design, #10554

Merged
merged 2 commits into from Feb 17, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 9 additions & 1 deletion numpy/add_newdocs.py
Expand Up @@ -1775,7 +1775,7 @@ def luf(lamdaexpr, *args, **kwargs):
kind to which both ``type1`` and ``type2`` may be safely cast.
The returned data type is always in native byte order.

This function is symmetric and associative.
This function is symmetric, but rarely associative.

Parameters
----------
Expand Down Expand Up @@ -1817,6 +1817,14 @@ def luf(lamdaexpr, *args, **kwargs):
>>> np.promote_types('i4', 'S8')
dtype('S11')

An example of a non-associative case:

>>> p = np.promote_types
>>> p('S', p('i1', 'u1'))
dtype('S6')
>>> p(p('S', 'i1'), 'u1')
dtype('S4')

""")

add_newdoc('numpy.core.multiarray', 'min_scalar_type',
Expand Down