Pelokalan
Python ID
id en
Sign in
Project
library__collections.po Project files · python-docs-id-3.14 · Bahasa Indonesia
Module PO View only
Source text — English
Translation — Bahasa Indonesia
:class:`defaultdict`
:class:`defaultdict`
:class:`defaultdict` objects
objek :class:`defaultdict`
Return a new dictionary-like object. :class:`defaultdict` is a subclass of the built-in :class:`dict` class. It overrides one method and adds one writable instance variable. The remaining functionality is the same as for the :class:`dict` class and is not documented here.
:class:`defaultdict` objects support the following method in addition to the standard :class:`dict` operations:
:class:`defaultdict` objects support the following instance variable:
:class:`defaultdict` Examples
Contoh :class:`defaultdict`
Setting the :attr:`~defaultdict.default_factory` to :class:`int` makes the :class:`defaultdict` useful for counting (like a bag or multiset in other languages):
Setting the :attr:`~defaultdict.default_factory` to :class:`set` makes the :class:`defaultdict` useful for building a dictionary of sets: