Code Inspections with quick fixes for python annotations
All product with python — 2020.1 — 2020.3(eap)
- Replace
UnionwithNonewithOptional
# before
def str_to_int(value: str) -> Union[int, None]:
...
# after quickfix
def str_to_int(value: str) -> Optional[int]:
...- Replace
Unionwithobjectwithobject
# before
def some_func(value: Any) -> Union[int, object]:
...
# after quickfix
def some_func(value: Any) -> object:
...- Replace
Unionwith one item with item
# before
def parse_json(value: str) -> Union[dict]:
...
# after quickfix
def parse_json(value: str) -> dict:
...