Skip to main content

flatten_result

Turn the given source sequence into a list of reg-exp possibilities and their arguments. Return a list of strings and a list of argument lists. Each of the two lists will be of the same length.

def flatten_result(
source: Union[Sequence, Group, Choice, NonCapture, None]
) - > tuple

Turn the given source sequence into a list of reg-exp possibilities and their arguments. Return a list of strings and a list of argument lists. Each of the two lists will be of the same length.

Parameters

NameTypeDescription
sourceUnion[Sequence, Group, Choice, NonCapture, None]The input sequence or expression object to be expanded into its constituent string patterns and associated parameters.

Returns

TypeDescription
tupleA tuple containing two lists: the first is a list of flattened regular expression strings, and the second is a list of lists containing the corresponding arguments for each possibility.