Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
e93b06a0
Commit
e93b06a0
authored
Feb 10, 2016
by
Guido van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Hopefully clarify the difference between Optional[t] and an optional argument.
parent
48a583b1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
0 deletions
+7
-0
Doc/library/typing.rst
Doc/library/typing.rst
+7
-0
No files found.
Doc/library/typing.rst
View file @
e93b06a0
...
...
@@ -286,6 +286,13 @@ The module defines the following classes, functions and decorators:
``Optional[X]`` is equivalent to ``Union[X, type(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
default needn't use the ``Optional`` qualifier on its type
annotation (although it is inferred if the default is ``None``).
A mandatory argument may still have an ``Optional`` type if an
explicit value of ``None`` is allowed.
.. class:: Tuple
Tuple type; ``Tuple[X, Y]`` is the is the type of a tuple of two items
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment