Skip to main content
atoti.StringComparison(
    *,
    case: Literal[‘sensitive’, ‘insensitive’] = 'sensitive',
    digits: Literal[‘lexicographic’, ‘numeric’] = 'lexicographic',
)
How strings are compared. Objects that do not implement Comparable are compared through their string representation, so these options apply to them too. Ignored for all the other data types.
Comparing digits character by character:
Comparing digits by their numeric value:
When letters are compared case-sensitively, uppercase elements come first:
When letters are compared case-insensitively, elements differing only by case remain distinct, with the uppercase one first:
Added in version 6.2.1.

Attributes

case

How letters are compared.
  • "sensitive": letters differing only by case are different.
  • "insensitive": the case is ignored.

digits

How digit sequences are compared.
  • "lexicographic": character by character.
  • "numeric": by their value.