Runtime Utility Methods

types.MappingProxyType.keys()

Expose the wrapped mapping’s keys; for a dictionary the view is live, not a snapshot.

Formal Syntax & Structure

python syntaxpython
proxy.keys()

Return Value

mapping view

The mapping view result described above.

Working Example

Example Snippetpython
import typesd={"x":1}; p=types.MappingProxyType(d); v=p.keys(); d["y"]=2print(list(v))
Python Reference