def make_instance_to_initdict(attributes: List[str]) -> InstanceToDictFnType:
    """
    Returns a function that takes an object (instance) and produces an
    ``InitDict`` enabling its re-creation.
    """
    def custom_instance_to_initdict(x: Instance) -> InitDict:
        kwargs = {}
        for a in attributes:
            kwargs[a] = getattr(x, a)
        return kwargs_to_initdict(kwargs)

    return custom_instance_to_initdict
def make_instance_to_initdict ( attributes : List [ str ] ) -> InstanceToDictFnType : def custom_instance_to_initdict ( x : Instance ) -> InitDict : kwargs = { } for a in attributes : kwargs [ a ] = getattr ( x , a ) return kwargs_to_initdict ( kwargs ) return custom_instance_to_initdict
Returns a function that takes an object (instance) and produces an
    ``InitDict`` enabling its re-creation.