renku-python
renku-python copied to clipboard
Remove implicit_optional = true in mypy
So in mypy 0.991 or 0.990 they added a breaking change for implicit optional types for arguments.
Before if you just assigned None as a default for an argument (without adding Optional to the type) mypy considered if as if the argument truly had the Optional type. I.e. def func(a: int = None) === def func(a: Optional[int] = None). Now mypy will raise an error on def func(a: int = None).
To avoid these errors, I added the implicit_optional = true flag in our pyproject.toml. We should remove this flag from our config and make sure we correct all the errors that mypy will report then.