def password_validator(optdict, name, value): """validate and return a string for option of type 'password'""" return optparse.check_password(None, name, value)