nextpyp.client.gen.none_raise#

nextpyp.client.gen.none_raise(val, func)#

if the optional type is None, raise the exception created by the lambda (because apparently Python doesn’t allow lambdas consisting only of raise statements), so we can avoid using intermediate variables and simplify the code generator

Return type:

TypeVar(T)

Parameters:
  • val (T | None) –

  • func (Callable[[], Exception]) –