class_docstr: OutcomeException and its subclass instances indicate and contain info
  about test and collection outcomes.
class_docstr_tok: ["OutcomeException","and","its","subclass","instances","indicate","and","contain","info","about","test","and","collection","outcomes","."]
code: def __init__(
      self, msg: Optional[str] = None, pytrace: bool = True
  ) -> None:
      if msg is not None and not isinstance(msg, str):
          error_msg = (  # type: ignore[unreachable]
              "{} expected string as 'msg' parameter, got '{}' instead.\n"
              "Perhaps you meant to use a mark?"
          )
          raise TypeError(
              error_msg.format(type(self).__name__, type(msg).__name__)
          )
      super().__init__(msg)
      self.msg = msg
      self.pytrace = pytrace
  
imports: import sys
  from typing import Any
  from typing import Callable
  from typing import cast
  from typing import NoReturn
  from typing import Optional
  from typing import Protocol
  from typing import Type
  from typing import TypeVar
label_desc: Use image node_id 1 to create a new OutcomeException object from inherited base classes: BaseException with example: obj = OutcomeException(msg, pytrace)