--- id: infinity version: "1.5" license: BSD license_treatment: permissive maintenance: abandoned --- # infinity — All-in-one infinity value for Python. Can be compared to any object. License: permissive · Maintenance: abandoned · Downloads: 183.0K/mo ## What it is and what it does infinity provides a single Infinity class that represents an infinity value comparable to any object in Python, addressing limitations of the built-in float('inf'). Unlike float infinity, the Infinity class supports rich comparisons with arbitrary types (e.g., datetime objects) and enforces mathematically correct behavior—for instance, pow(1, inf) raises TypeError rather than returning 1. The package supports arithmetic operations (addition, subtraction, multiplication, division, exponentiation) with sensible semantics: inf + 3 returns inf, 5 / inf returns 0, but undefined operations like inf - inf or pow(1, inf) raise TypeError. It also coerces to float, string, and boolean types. However, the package has been abandoned since 2020 with no active maintenance. Use it for: - Implementing algorithms that need a universal upper or lower bound comparable to any type, not just numbers - Creating priority queues or sorting logic where infinity must compare correctly with dates, strings, or custom objects - Building mathematical or constraint-solving code that requires strict handling of undefined operations like inf - inf - Replacing ad-hoc sentinel values (e.g., sys.maxsize) with a proper infinity abstraction ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Provides an Infinity class that can be compared to any object and supports arithmetic operations, offering a more flexible alternative to Python's built-in float('inf'). No. The package is abandoned (last release 2020-06-03, no commits since) and high install friction makes it a poor choice for new projects. Modern Python versions have better alternatives: use float('inf') for numeric comparisons, or implement a custom comparable wrapper for your specific type. Only consider it if you have legacy code already depending on it. ## Install pip install infinity uv add infinity poetry add infinity ## Installing infinity Before you install: High install friction due to source distribution format. Package is abandoned—last release was 2020-06-03 with no maintenance activity since. Use only if you cannot migrate to a maintained alternative. License in practice: BSD license is permissive, allowing commercial and private use with minimal restrictions. Quickstart: pip install infinity from infinity import inf print(3 < inf) # True print(inf + 5) # inf print(float(inf) == float('inf')) # True Verify before relying: - Whether the package works reliably with Python versions beyond 3.5, given its abandoned status and age - Whether arithmetic behavior matches mathematical conventions in all edge cases ## Package facts - License: BSD (permissive) - Python support: unspecified - Install friction: high - Maintenance: abandoned - Downloads: 183.0K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags infinity value comparison, infinite number python, comparable infinity object, arithmetic with infinity, inf class implementation, numeric-sentinel, comparison-protocol [View on SkillFed](https://skillfed.io/packages/infinity) · [View on PyPI](https://pypi.org/project/infinity/)