class DictAction(argparse.Action):

    def __call__(self, parser, namespace, values, option_string=None):
        value_dict = {'on': True, 'off': False, 'switch': None}
setattr(namespace, self.dest, value_dict.get(values))
parser.add_argument('-v', '--value', action=DictAction, choices=['on',
    'off', 'switch'], default=None)
Use dictionary for Python argparse