(original) (raw)
There's a proposal to change one detail of PEP 484\. It currently says:
Now that we've got some experience actually using Optional with mypy (originally mypy ignored Optional), we're beginning to think that this was a bad idea. There's more discussion at https://github.com/python/typing/issues/275 and an implementation of the change (using a command-line flag) in https://github.com/python/mypy/pull/3248.An optional type is also automatically assumed when the default value is
None
, for example::def handle\_employee(e: Employee = None): ...
This is equivalent to::
def handle\_employee(e: Optional\[Employee\] = None) -> None: ...