Headers
and MutableHeaders
do not respect Mapping
and MutableMapping
interfaces
#1652
Unanswered
adriangb
asked this question in
Potential Issue
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
For example, we have
def keys(self) -> typing.List
when it should bedef keys(self) -> typing.KeysView[str]
(KeysView
acts like a set).In
{Immutable}MultiDict
we solve this by havingmulti_items(self) -> typing.List[typing.Tuple[KeyType, ValueType]]
.I feel that
Headers
andMutableHeaders
should reflect what we do inImmutableMultiDict
andMultiDict
. We could probably also do some more code sharing (haveprocess_{keys,values}
hooks inImmutableMultiDict
andMultiDict
or something like that).All this said, I'm not sure we could make these changes without it being a breaking change 😞
Beta Was this translation helpful? Give feedback.
All reactions