Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 48a583b commit e93b06aCopy full SHA for e93b06a
1 file changed
Doc/library/typing.rst
@@ -286,6 +286,13 @@ The module defines the following classes, functions and decorators:
286
287
``Optional[X]`` is equivalent to ``Union[X, type(None)]``.
288
289
+ Note that this is not the same concept as an optional argument,
290
+ which is one that has a default. An optional argument with a
291
+ default needn't use the ``Optional`` qualifier on its type
292
+ annotation (although it is inferred if the default is ``None``).
293
+ A mandatory argument may still have an ``Optional`` type if an
294
+ explicit value of ``None`` is allowed.
295
+
296
.. class:: Tuple
297
298
Tuple type; ``Tuple[X, Y]`` is the is the type of a tuple of two items
0 commit comments