| 94 | |
| 95 | |
| 96 | def _check_order(types1, types2): |
| 97 | dtype_order = allP + "O" |
| 98 | for t1, t2 in zip(types1, types2): |
| 99 | # We have no opinion on object or time ordering for now: |
| 100 | if t1 in "OP" or t2 in "OP": |
| 101 | return True |
| 102 | if t1 in "mM" or t2 in "mM": |
| 103 | return True |
| 104 | |
| 105 | t1i = dtype_order.index(t1) |
| 106 | t2i = dtype_order.index(t2) |
| 107 | if t1i < t2i: |
| 108 | return |
| 109 | if t2i > t1i: |
| 110 | break |
| 111 | |
| 112 | if types1 == "QQ?" and types2 == "qQ?": |
| 113 | # Explicitly allow this mixed case, rather than figure out what order |
| 114 | # is nicer or how to encode it. |
| 115 | return |
| 116 | |
| 117 | raise TypeError( |
| 118 | f"Input dtypes are unsorted or duplicate: {types1} and {types2}") |
| 119 | |
| 120 | |
| 121 | def check_td_order(tds): |