I want to add some custom annotations on my variables. For example,
def idiv(left: int, right: int | right != 0) -> int:
return left // right
Mypy accepts only PEP 484 type hints, so I'd like to provide a plugin to pre-process this annotation and return a PEP 484-compatible hint before Mypy checks it. Could Mypy provide a preprocessing hook for such transformations?
I want to add some custom annotations on my variables. For example,
Mypy accepts only PEP 484 type hints, so I'd like to provide a plugin to pre-process this annotation and return a PEP 484-compatible hint before Mypy checks it. Could Mypy provide a preprocessing hook for such transformations?