{"categories":[{"label":"Software Development","url":"https://skillfed.io/packages/category/software-development/8"}],"enrichment":{"capability":"Provides a mutable and immutable multiset data structure that extends Python's set semantics to allow duplicate elements, supporting set operations like union, intersection, and difference.","skillfed_tags":["data-structures","set-operations"],"use_cases":["Counting occurrences of hashable items while performing set operations like union or intersection","Implementing algorithms that require multiset semantics (e.g., graph theory, combinatorics) where duplicate membership matters","Using multisets as dictionary keys or in sets by wrapping them in FrozenMultiset for immutability and hashability","Comparing collections where element frequency and set relationships both matter (e.g., checking if one multiset is a sub-multiset of another)","Replacing ad-hoc Counter-based logic when you need proper set operations rather than frequency counting"],"what_it_does":"Multiset is a data structure that extends Python's built-in set to allow elements to appear multiple times. Like a set, it requires elements to be hashable and supports the same operations\u2014membership tests, union, intersection, symmetric difference\u2014but tracks how many times each element occurs. The package provides both a mutable Multiset class and an immutable FrozenMultiset (similar to frozenset) that is also hashable.\n\nUnlike collections.Counter from the standard library, multiset enforces proper set semantics: it only allows positive counts, automatically removes elements with zero multiplicity, and supports all standard set operations without treating the collection as a frequency counter. The implementation uses a dictionary internally to map elements to their counts, making it suitable for algorithms that need set operations on collections with duplicates.","worth_installing":"Yes, if you need set operations on collections with duplicates. The package is stable, has zero dependencies, and installs easily. However, maintenance is dormant (last release 717 days ago), so consider whether you need active support or can rely on a mature, unchanging implementation. For simple frequency counting, collections.Counter may be sufficient; reach for multiset when you specifically need set semantics with duplicates."},"id":"multiset","links":{"html":"https://skillfed.io/packages/multiset","md":"https://skillfed.io/packages/multiset.md","pypi":"https://pypi.org/project/multiset/"},"maintenance":{"status":"dormant"},"meta":{"latest_release":"2024-08-27","license_spdx":null,"license_treatment":"permissive","name":"multiset","python_support":"supports_current","summary":"An implementation of a multiset."},"popularity":{"monthly_downloads":453051,"position":6578,"tier":"top_15000"},"security":{"n_vulnerabilities":0},"version":"3.2.0"}
