def typed_dict(key_type, value_type, default):
 return (lambda setting: {key_type(StringConverter(key)): (value_type(StringConverter(value)) if (value != '') else default) for (key, value) in dict(setting).items()})

def typed_dict ( key_type , value_type , default ) : return ( lambda setting : { key_type ( StringConverter ( key ) ) : ( value_type ( StringConverter ( value ) ) if ( value != '' ) else default ) for ( key , value ) in dict ( setting ) . items ( ) } )
creates a function that converts a setting into a dict with the given types .