code: def expect(self, msg) -> T:
          
          if self._is_ok:
              return cast(T, self._val)
          raise ValueError(msg)
docs: Returns the success value in the :class:`Result` or raises
          a ``ValueError`` with a provided message.
  
          Args:
              msg: The error message.
  
          Returns:
              The success value in the :class:`Result` if it is
              a :meth:`Result.Ok` value.
  
          Raises:
              ``ValueError`` with ``msg`` as the message if the
              :class:`Result` is a :meth:`Result.Err` value.
  
          Examples:
              >>> Ok(1).expect('no')
              1
              >>> try:
              ...     Err(1).expect('no')
              ... except ValueError as e:
              ...     print(e)
              no