File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -59,6 +59,9 @@ Type aliases are useful for simplifying complex type signatures. For example::
5959 servers: List[Tuple[Tuple[str, int], Dict[str, str]]]) -> None:
6060 ...
6161
62+ Note that ``None `` as a type hint is a special case and is replaced by
63+ ``type(None) ``.
64+
6265NewType
6366-------
6467
@@ -148,7 +151,6 @@ For example::
148151It is possible to declare the return type of a callable without specifying
149152the call signature by substituting a literal ellipsis
150153for the list of arguments in the type hint: ``Callable[..., ReturnType] ``.
151- ``None `` as a type hint is a special case and is replaced by ``type(None) ``.
152154
153155Generics
154156--------
@@ -443,7 +445,7 @@ The module defines the following classes, functions and decorators:
443445
444446 Optional type.
445447
446- ``Optional[X] `` is equivalent to ``Union[X, type( None) ] ``.
448+ ``Optional[X] `` is equivalent to ``Union[X, None] ``.
447449
448450 Note that this is not the same concept as an optional argument,
449451 which is one that has a default. An optional argument with a
You can’t perform that action at this time.
0 commit comments