def __call__(self, csv):
args = csv.split(',')
remainder = sorted(set(args) - set(self.choices))
if remainder:
msg = "invalid choices: %r (choose from %r)" % (remainder, self.choices)
raise argparse.ArgumentTypeError(msg)
return args
评论列表
文章目录