So I know the standard use case of Typing.Optional, which means it is a union between the type and None. E.g.
def my_func(a, b=None):
# type: (str, Typing.Optional[str]) -> str
# do stuff with the strings
But what if the default value for B is an actual string?
def my_func(a, b='hello'):
Should the type of b be Optional[str] or just str? Because it is optional from the perspective of the user because you aren't required to pass a value when calling this function, but that doesn't mean None should work though. Mypy doesn't seem to detect a problem with either one.