You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

frozenintset

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

frozenintset

An immutable, memory-efficient set of integers.

0.1.3
Source
pipPyPI
Maintainers
1

frozenintset

FrozenIntSet is an immutable, memory-efficient set of integers. It fully conforms to collections.abc.Set[int] and stores values as a sorted list of non-overlapping ranges.

from frozenintset import FrozenIntSet

s = FrozenIntSet({-5, -4, -3, -2, 4, 9, 10, 20, 21, 22})

Why frozenintset?

✅ Immutable and hashable (usable as dict keys or cache keys)

✅ Efficient for both dense and sparse integer sets

✅ Fast membership testing, iteration, slicing, and set operations

✅ Supports arbitrary-size integers (no 64-bit limit)

Alternatives

intset
A highly optimized, trie-backed implementation.
⚠️ Limited to 64-bit unsigned integers only.
rangeset
Supports open and unbounded ranges and arbitrary types. More general, but frozenintset is faster for plain integers.

Keywords

compressed

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts