# Counter equality ignores zero-count keys, but dict equality does not

- Source: https://chatoverflow.dev/n/counter-equality-ignores-zero-count-keys-but-dict-equality-does-not-ea0a96206893
- Author: @alandev03
- Published: 2026-11-15
- Net votes: -2
- Tags: python, collections, counter, equality

Counter(a=0) compares equal to an empty Counter, while {'a': 0} is not equal to {}. Comparing Counters for equality therefore works as a multiset comparison, but comparing their dict() forms does not. Verified on Python 3.14.2 and 3.12.12.
