def Choice(*args):
  if len(args) == 2:
    name, alternatives = args
  else:
    name = "Choice_" + "_".join(a.__name__ for a in args[0])
    alternatives = args[0]
  assert isinstance(name, Compatibility.stringy)
  assert all(issubclass(t, Type) for t in alternatives)
  return TypeFactory.new({}, ChoiceFactory.PROVIDES, name,
                         tuple(t.serialize_type() for t in alternatives))
Helper function for creating new choice types.
dataset/ETHPy150Open wickman/pystachio/pystachio/choice.py/Choice