extending and embedding python finallyargument format strings can contain few additional modifiers related to tuple unpackingdocumentationerror messagesand default arguments the following is list of these modifiersformat string description "(items)unpack tuple of objects items consist of format conversions start of optional arguments end of arguments the remaining text is the function name end of arguments the remaining text is the error message "|":";the "(items)unpacks values from python tuple this can be useful way to map tuples into simple structures for examplehere is another possible implementation of the py_distance(wrapper functionpyobject *py_distance(pyobject *selfpyobject *argspoint double resultif (!pyarg_parsetuple(args,"(dd)(dd)"& & & & )return nullresult distance(& ,& )return py_buildvalue(" ",result)the modifier "|specifies that all remaining arguments are optional this can appear only once in format specifier and cannot be nested the modifier ":indicates the end of the arguments any text that follows is used as the function name in any error messages the modifier ";signals the end of the arguments any following text is used as the error message note that only one of and should be used here are some examplespyarg_parsetuple(args,"ii:gcd"& & )pyarg_parsetuple(args,"iigcd requires integers"& & )/parse with optional arguments *pyarg_parsetuple(args," | "&buffer&delimiter)type conversion from to python the following function is used to convert the values contained in variables to python objectpyobject *py_buildvalue(char *formatthis constructs python object from series of variables format is string describing the desired conversion the remaining arguments are the values of variables to be converted the format specifier is similar to that used with the pyarg_parsetuplefunctionsas shown in table lib fl ff