When inlining the type annotations, I noticed that iter_multi_items and related methods were annotated to accept collections.abc.Iterable, but actually called isinstance(value, (list, tuple). I expanded this to isinstance(value, Container) and not isinstance(value, str). However, this incorrectly matched and iterated over bytes, bytearray, memoryview, array, etc, all of which should be treated as single values. Rather than trying to build up an allow list, I've gone back to restricting to (list, tuple, set), adding set since it was the one built-in collection type missing that would make sense to use.
When inlining the type annotations, I noticed that
iter_multi_items
and related methods were annotated to acceptcollections.abc.Iterable
, but actually calledisinstance(value, (list, tuple)
. I expanded this toisinstance(value, Container) and not isinstance(value, str)
. However, this incorrectly matched and iterated overbytes
,bytearray
,memoryview
,array
, etc, all of which should be treated as single values. Rather than trying to build up an allow list, I've gone back to restricting to(list, tuple, set)
, addingset
since it was the one built-in collection type missing that would make sense to use.fixes #2994