pylint/utils/utils.py
def _format_option_value(optdict, value):
    """return the user input's value from a 'compiled' value"""
    if isinstance(value, (list, tuple)):
        value = ",".join(_format_option_value(optdict, item) for item in value)
    elif isinstance(value, dict):
        value = ",".join("%s:%s" % (k, v) for k, v in value.items())
    elif hasattr(value, "match"):  # optdict.get('type') == 'regexp'
        # compiled regexp
        value = value.pattern
    elif optdict.get("type") == "yn":
        value = "yes" if value else "no"
    elif isinstance(value, str) and value.isspace():
        value = "'%s'" % value
    return value
def _format_option_value(optdict, value):
    if isinstance(value, (list, tuple)):
        value = ",".join(_format_option_value(optdict, item) for item in value)
    elif isinstance(value, dict):
        value = ",".join("%s:%s" % (k, v) for k, v in value.items())
    elif hasattr(value, "match"):  # optdict.get('type') == 'regexp'
        # compiled regexp
        value = value.pattern
    elif optdict.get("type") == "yn":
        value = "yes" if value else "no"
    elif isinstance(value, str) and value.isspace():
        value = "'%s'" % value
    return value
def _format_option_value ( optdict , value ) : if isinstance ( value , ( list , tuple ) ) : value = "," . join ( _format_option_value ( optdict , item ) for item in value ) elif isinstance ( value , dict ) : value = "," . join ( "%s:%s" % ( k , v ) for k , v in value . items ( ) ) elif hasattr ( value , "match" ) : # optdict.get('type') == 'regexp' # compiled regexp value = value . pattern elif optdict . get ( "type" ) == "yn" : value = "yes" if value else "no" elif isinstance ( value , str ) and value . isspace ( ) : value = "'%s'" % value return value
return the user input's value from a 'compiled' value
return the user input s value from a compiled value