Skip to main content
Version: Nightly

counter

Defines the Counter type.

Import these APIs from the collections package:

from std.collections import Counter

Counters provide convenient tallying objects that use a dictionary to store keys and their counts. They offer the full functionality of counted sets, also called bags or multisets, and extend that model by supporting negative counts.

Structs

  • Counter: A container for counting hashable items.
  • CountTuple: A tuple representing a value and its count in a Counter.