- If the Optional[Type] argument is None, however, raise an exception.
- Use this to satisfy most type checkers that a value that could
- be None isn't so as to drop the Optional typing hint.
+ Use this to satisfy most type checkers that a value that could be
+ None isn't so as to drop the Optional typing hint.
+
+ Args:
+ x: an Optional[Type] argument
+
+ Returns:
+ If the Optional[Type] argument is non-None, return it.
+ If the Optional[Type] argument is None, however, raise an
+ exception.