def to_object(item):
        """
        Convert a dictionary to an object (recursive).
        """
        def convert(item): 
            if isinstance(item, dict):
                return IterableObject({k: convert(v) for k, v in item.items()})
            if isinstance(item, list):
                def yield_convert(item):
                    for index, value in enumerate(item):
                        yield convert(value)
                return list(yield_convert(item))
            else:
                return item

        return convert(item)
def to_object ( item ) : def convert ( item ) : if isinstance ( item , dict ) : return IterableObject ( { k : convert ( v ) for k , v in item . items ( ) } ) if isinstance ( item , list ) : def yield_convert ( item ) : for index , value in enumerate ( item ) : yield convert ( value ) return list ( yield_convert ( item ) ) else : return item return convert ( item )
Convert a dictionary to an object (recursive).