diff --git a/pep-0484.txt b/pep-0484.txt index 39d72b077cd..97de11cc4e9 100644 --- a/pep-0484.txt +++ b/pep-0484.txt @@ -984,15 +984,17 @@ for example, the above is equivalent to:: def handle_employee(e: Optional[Employee]) -> None: ... -An optional type is also automatically assumed when the default value is -``None``, for example:: +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 is equivalent to:: +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. Support for singleton types in unions -------------------------------------