Open this example in the interactive library
Source code
from types import MappingProxyType
source = {'count': 1}
view = MappingProxyType(source)
source['count'] = 2
print(view['count'])Sample output
2

Open this example in the interactive library
from types import MappingProxyType
source = {'count': 1}
view = MappingProxyType(source)
source['count'] = 2
print(view['count'])2