def rv(symbol, cls, *args): args = list(map(sympify, args)) dist = cls(*args) dist.check(*args) return SingleDiscretePSpace(symbol, dist).value