Currently a dict_items object is bound, which was a misguided attempt in getting a read-only dictionary. The main problem is that it doesn't allow item access (get() and []).
The correct solution would be to return a mapping proxy, either via types.MappingProxyType or via items().mapping. The former exists since Python 3.3 and the latter since 3.10, so in case we ever want to backport the library to older Python versions I'll go with MappingProxyType.
Currently a
dict_items
object is bound, which was a misguided attempt in getting a read-only dictionary. The main problem is that it doesn't allow item access (get()
and[]
).The correct solution would be to return a mapping proxy, either via
types.MappingProxyType
or viaitems().mapping
. The former exists since Python 3.3 and the latter since 3.10, so in case we ever want to backport the library to older Python versions I'll go withMappingProxyType
.