String Validators

  • + 24 comments

    Me, neither. Combine with eval, code can be simplified to

    for test in ('isalnum', 'isalpha', 'isdigit', 'islower', 'isupper'):
            any(eval("c." + test + "()") for c in s)