pyparcel/api.py
def _conform_list(li: List[Any]) -> List[T]:
    """
    Ensures that every element in *li* can conform to one type
    :param li: list to conform
    :return: conformed list
    """
    conform_type = li[0].__class__
    for i in li:
        if isinstance(i, StrictType):
            conform_type = i.__class__
            break
    base_type = (
        conform_type.__base__ if conform_type.__base__ != object else None
    )  # do not let base_type be 'object'
    if not all(type(i) == conform_type or type(i) == base_type for i in li):
        raise Exception(f"{li} can not be conformed to the {conform_type}")
    return [i if isinstance(i, conform_type) else conform_type(i) for i in li]

    Ensures that every element in *li* can conform to one type
    :param li: list to conform
    :return: conformed list
    
Ensures that every element in *li* can conform to one type
Ensures that every element in * li * can conform to one type
def _conform_list(li: List[Any]) -> List[T]:
    conform_type = li[0].__class__
    for i in li:
        if isinstance(i, StrictType):
            conform_type = i.__class__
            break
    base_type = (
        conform_type.__base__ if conform_type.__base__ != object else None
    )  
    if not all(type(i) == conform_type or type(i) == base_type for i in li):
        raise Exception(f"{li} can not be conformed to the {conform_type}")
    return [i if isinstance(i, conform_type) else conform_type(i) for i in li]
def _conform_list ( li : List [ Any ] ) -> List [ T ] : conform_type = li [ 0 ] . __class__ for i in li : if isinstance ( i , StrictType ) : conform_type = i . __class__ break base_type = ( conform_type . __base__ if conform_type . __base__ != object else None ) if not all ( type ( i ) == conform_type or type ( i ) == base_type for i in li ) : raise Exception ( f"{li} can not be conformed to the {conform_type}" ) return [ i if isinstance ( i , conform_type ) else conform_type ( i ) for i in li ]
Ensures that every element in *li* can conform to one type
Ensures that every element in * li * can conform to one type
"""
    Ensures that every element in *li* can conform to one type
    :param li: list to conform
    :return: conformed list
    """ # do not let base_type be 'object'
None
li
List[Any]
list to conform
list to conform