ro_dict#

class caput.memdata.ro_dict(d=None)[source]#

Bases: collections.abc.Mapping

A dict that is read-only to the user.

This class isn’t strictly read-only but it cannot be modified through the traditional dict interface. This prevents the user from mistaking this for a normal dictionary.

Provides the same interface for reading as the builtin python dict but no methods for writing.

Parameters:
ddict | None

Initial data for the new dictionary.