Honour inc_array in is_binary

TL;DR

  • tango.utils.is_binary_type now honours its inc_array argument, like the five type predicates it is grouped with. It previously accepted the argument and ignored it.

Reported in #789.

Key Facts

  • Behaviour change for external callers. is_binary_type(DevVarCharArray) returned True with the default inc_array=False; it now returns False. Callers that want the array type matched must pass inc_array=True, as they already must for is_int_type, is_float_type, is_bool_type, is_str_type and is_numerical_type. is_binary_type is in the published API docs.
  • No in-tree caller is affected: nothing in tango/ or tests/ calls is_binary or is_binary_type.
  • The cause was the data, not the body. _binary_types held the scalar and array types in one tuple, so there was nothing to gate on. Splitting it into _scalar_binary_types and _array_binary_types lets the body take the same shape as its siblings.
  • _binary_types is removed rather than kept as an alias. It had no other reader once the body stopped using it, and no sibling predicate keeps a combined tuple — there is no _str_types, only the scalar/array pair. Leaving it would have added dead code in a bug fix.
  • The test covers the whole predicate group in one parametrised case, not just is_binary, so a future member that stops honouring the flag is reported against the others. That is the divergence this MR is correcting, and #789 notes it as the reason the defect went unnoticed.

Caveats

  • The first commit adds the test and fails for is_binary on its own; the second makes it pass.
  • The alternative was to drop inc_array from the signature instead. Honouring it is what the docstring has always promised and what makes the group uniform, but it is the option that changes behaviour, so it is worth a maintainer's confirmation.
  • Builds on !1075 (merged) and targets its branch. Retarget as the chain merges.

🤖 Generated with Claude Code

Merge request reports

Loading
Loading