Right now inferTypeOpInterface.inferReturnTypes fails because there's a cast in there to py::sequence which throws a TypeError when it tries to cast the Nones. Note Nones are inserted into operands for omitted operands passed to the generated builder:
operands.append(_get_op_result_or_value(start) if start is not None else None) operands.append(_get_op_result_or_value(stop) if stop is not None else None) operands.append(_get_op_result_or_value(step) if step is not None else None)
Note also that skipping appending to the list operands doesn't work either because build generic checks against the number of operand segments expected.
Currently the only way around is to handroll through ir.Operation.create.
This cast fails.