projects
/
python_utils.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
Minor editing.
[python_utils.git]
/
type_utils.py
1
#!/usr/bin/env python3
2
3
import logging
4
from typing import Any, Optional
5
6
logger = logging.getLogger(__name__)
7
8
9
def unwrap_optional(x: Optional[Any]) -> Any:
10
if x is None:
11
msg = 'Argument to unwrap_optional was unexpectedly None'
12
logger.critical(msg)
13
raise AssertionError(msg)
14
return x