def check(value): if '=' not in value: raise argparse.ArgumentTypeError('%s is not a k=v string' % (value)) return tuple(value.split('=', 2))