Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
self.x = ChainMap()
@classmethod
def from_maps(cls, maps: List[Mapping]):
inst = cls()
inst.x = ChainMap(*maps)
return inst
def to_maps(self):
return self.x.maps
def __repr__(self):
return f"CustomSerializableChainMap({str(self.x)})"
class CustomSerializableMapping(dict, SerializableMapping):
def __init__(self):
super().__init__()
self.x = {}
@classmethod
def from_mapping(cls, mapping):
inst = cls()
inst.x = {**mapping}
return inst
def to_mapping(self):
return self.x
def __repr__(self):
return f"CustomSerializableMapping({str(self.x)})"