Explicitly fail when a Mapping or Set object is passed to assertSequenceStartsWith as the whole argument.
Previously, when passed a Mapping or Set object, it raises a TypeError. Except starting with Python 3.12, it raises a KeyError for a Mapping object because slice objects are now hashable (i.e. a_dict[:2] usually raises a KeyError).
This change makes the unexpected inputs fail more explicitly.
Explicitly fail when a Mapping or Set object is passed to assertSequenceStartsWith as the
whole
argument.Previously, when passed a Mapping or Set object, it raises a TypeError. Except starting with Python 3.12, it raises a KeyError for a Mapping object because slice objects are now hashable (i.e.
a_dict[:2]
usually raises aKeyError
).This change makes the unexpected inputs fail more explicitly.