A past version of this PEP allowed type checkers to assume an optional type when the default value is None, as in this code:
def handle_employee(e: Employee = None): ...
This would have been treated as equivalent to:
def handle_employee(e: Optional[Employee] = None) -> None: ...
This is no longer the recommended behavior. Type checkers should move towards requiring the optional type to be made explicit.
https://www.python.org/dev/peps/pep-0484/
We currently use implicit Optionals. mypy still allows them but may change this in the future.
https://www.python.org/dev/peps/pep-0484/
We currently use implicit
Optionals. mypy still allows them but may change this in the future.