diff -r 208e1ed48cd3 -r acd9dec5f215 Doc/library/typing.rst --- a/Doc/library/typing.rst Sun Sep 11 01:41:01 2016 +0300 +++ b/Doc/library/typing.rst Sat Sep 10 17:19:45 2016 -0700 @@ -59,6 +59,9 @@ servers: List[Tuple[Tuple[str, int], Dict[str, str]]]) -> None: ... +Note that ``None`` as a type hint is a special case and is replaced by +``type(None)``. + NewType ------- @@ -148,7 +151,6 @@ It is possible to declare the return type of a callable without specifying the call signature by substituting a literal ellipsis for the list of arguments in the type hint: ``Callable[..., ReturnType]``. -``None`` as a type hint is a special case and is replaced by ``type(None)``. Generics -------- @@ -443,7 +445,7 @@ Optional type. - ``Optional[X]`` is equivalent to ``Union[X, type(None)]``. + ``Optional[X]`` is equivalent to ``Union[X, None]``. Note that this is not the same concept as an optional argument, which is one that has a default. An optional argument with a