diff options
Diffstat (limited to 'numpy/add_newdocs.py')
-rw-r--r-- | numpy/add_newdocs.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/numpy/add_newdocs.py b/numpy/add_newdocs.py index 7dfecdb80..9740292bb 100644 --- a/numpy/add_newdocs.py +++ b/numpy/add_newdocs.py @@ -1775,7 +1775,7 @@ add_newdoc('numpy.core.multiarray', 'promote_types', 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 ---------- @@ -1817,6 +1817,14 @@ add_newdoc('numpy.core.multiarray', 'promote_types', >>> 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', |