Skip to content

Commit 98e77b2

Browse files
committed
Last doc/comment tweaks
1 parent 0ca5628 commit 98e77b2

2 files changed

Lines changed: 4 additions & 7 deletions

File tree

CLAUDE.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
55

66
## Project Overview
77

8-
**bitmath** is a pure-Python library (no external runtime dependencies) for representing and converting file sizes across SI (decimal) and NIST (binary) unit systems. It supports arithmetic, rich comparisons, bitwise ops, parsing, formatting, and f-string/format() support.
8+
**bitmath** is a pure-Python library (no external runtime dependencies) for representing and converting file sizes across SI (decimal) and NIST (binary) unit systems. It supports arithmetic (including floor division, modulo, and `divmod` for capacity math), rich comparisons, bitwise ops, parsing, formatting, and f-string/format() support.
99

1010
## Project Direction
1111
bitmath has been around for almost 12 years, and over that lifetime it promised to deliver backwards compatibility. It delivered on that promise and gathered a strong supporting of people and eventual "critical infrastructure" project status on the PyPI.org website.
@@ -20,7 +20,7 @@ Phases 1 (maintenance 1.4.0) and 2 (bitmath 2.0.0) are complete. The project:
2020

2121
- Supports **Python 3.9 and newer only** (`requires-python = ">=3.9"` in `pyproject.toml`)
2222
- Uses `hatchling` as the build backend (replaces `setup.py`)
23-
- Uses `pytest` as the test runner (292 tests, 99% coverage — one branch in `system` property intentionally uncovered)
23+
- Uses `pytest` as the test runner (303 tests). Coverage is high but platform-sensitive: the `query_device_capacity` branches for the *other* OS are naturally uncovered on any single run.
2424
- Is published on PyPI as version 2.0.0
2525
- Drop-in compatible with the 1.x public API
2626

@@ -61,7 +61,7 @@ All unit values are normalized to bits internally; conversion between units happ
6161
- `getsize(path, ...)` — file size with automatic prefix selection
6262
- `listdir(search_base, ...)` — recursive directory listing with sizes
6363
- `parse_string(s)` / `parse_string_unsafe(s, system=SI)` — string → bitmath object
64-
- `query_device_capacity(device_fd)`POSIX device capacity (Linux/macOS)
64+
- `query_device_capacity(device_fd)`block device capacity on Linux (POSIX/`fcntl`) and Windows (`DeviceIoControl`); raises `NotImplementedError` on unsupported platforms (macOS lacks a usable ioctl under SIP)
6565

6666
**Constants:** `NIST`, `SI`, `NIST_PREFIXES`, `SI_PREFIXES`, `ALL_UNIT_TYPES`
6767

@@ -70,5 +70,5 @@ All unit values are normalized to bits internally; conversion between units happ
7070
- Test runner: `pytest`
7171
- All tests are in `tests/` as `test_*.py` files
7272
- Test case names must be unique across the suite — enforced by `tests/test_unique_testcase_names.sh`
73-
- Coverage: 99% (one branch in `system` property intentionally uncovered)
73+
- Coverage is platform-sensitive: Windows and POSIX `query_device_capacity` paths only run on their respective OS
7474
- `unittest.mock` (stdlib) is used for patching in integration tests

bitmath/__init__.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -889,9 +889,6 @@ def __divmod__(self, other):
889889
"""
890890
return (self.__floordiv__(other), self.__mod__(other))
891891

892-
# def __pow__(self, other, modulo=None):
893-
# return NotImplemented
894-
895892
##################################################################
896893

897894
"""These methods are called to implement the binary arithmetic

0 commit comments

Comments
 (0)