Compare these two functions:
from typing import Optional
def foo1(bar: str = None) -> None:
print(bar)
def foo2(bar: Optional[str] = None) -> None:
print(bar)
Mypy doesn't complain about either of them. Is the Optional[]
really necessary then? Is there any subtle difference between these two declarations?