Closed jj-github-jj closed 1 year ago
Hi,
dict.keys()
does actually not return a list
but a dict_keys
(dictionary view) object. See here for more infos.
MetaDict
also returns a dictionary view object.
from metadict import MetaDict
print(isinstance({}.keys(), type(MetaDict(a=1).keys())))
>> True
So the return type of MetaDict.keys()
is compatible to dict.keys()
.
dict.keys() returns list but using .keys() function with metadict returns KeysView object