class types.MappingProxyType(mapping)
Read-only proxy of a mapping. It provides a dynamic view on the mapping’s entries, which means that when the mapping changes, the view reflects these changes.
New in version 3.3.
-
key in proxy -
Return
Trueif the underlying mapping has a key key, elseFalse.
-
proxy[key] -
Return the item of the underlying mapping with key key. Raises a
KeyErrorif key is not in the underlying mapping.
-
iter(proxy) -
Return an iterator over the keys of the underlying mapping. This is a shortcut for
iter(proxy.keys()).
-
len(proxy) -
Return the number of items in the underlying mapping.
-
copy() -
Return a shallow copy of the underlying mapping.
-
get(key[, default]) -
Return the value for key if key is in the underlying mapping, else default. If default is not given, it defaults to
None, so that this method never raises aKeyError.
-
items() -
Return a new view of the underlying mapping’s items (
(key, value)pairs).
-
keys() -
Return a new view of the underlying mapping’s keys.
-
values() -
Return a new view of the underlying mapping’s values.
Please login to continue.