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