Add DefaultDict to PEP 484.

This commit is contained in:
Guido van Rossum 2016-04-05 09:16:06 -07:00
parent 9f33fa7793
commit 3f5669021e
1 changed files with 7 additions and 4 deletions

View File

@ -1337,6 +1337,9 @@ Generic variants of builtin collections:
* Dict, used as ``Dict[key_type, value_type]``
* DefaultDict, used as ``DefaultDict[key_type, value_type]``,
a generic variant of ``collections.defaultdict``
* List, used as ``List[element_type]``
* Set, used as ``Set[element_type]``. See remark for ``AbstractSet``
@ -1344,10 +1347,10 @@ Generic variants of builtin collections:
* FrozenSet, used as ``FrozenSet[element_type]``
Note: ``Dict``, ``List``, ``Set`` and ``FrozenSet`` are mainly useful
for annotating return values. For arguments, prefer the abstract
collection types defined below, e.g. ``Mapping``, ``Sequence`` or
``AbstractSet``.
Note: ``Dict``, ``DefaultDict``, ``List``, ``Set`` and ``FrozenSet``
are mainly useful for annotating return values.
For arguments, prefer the abstract collection types defined below,
e.g. ``Mapping``, ``Sequence`` or ``AbstractSet``.
Generic variants of container ABCs (and a few non-containers):