Skip to main content

force_mapping

Wrap object into supporting the mapping interface if necessary.

def force_mapping(
m: Any
) - > Mapping

Wrap object into supporting the mapping interface if necessary.

Parameters

NameTypeDescription
mAnyThe object to be converted or wrapped into a mapping-compatible interface, such as a LazyObject or a standard class instance.

Returns

TypeDescription
MappingThe original object if it already implements the Mapping interface, or a DictAttribute wrapper that provides mapping access to the object's attributes.