Registry / data / iterpop

iterpop

JSON →
library0.4.1pypypiunverified

iterpop provides safe and convenient functions to pop a single value from a container, avoiding manual length checks. Current version 0.4.1, stable. Low release cadence.

pip install iterpop
INSTALL
IMPORT
SIG · ITERPOP
I
iterpop
datapythonv0.4.1
Install
1.5s avg
Import
Disk
16MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.4.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 17.8MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.5s · import 0.000s · 18MB
16MB installed
● package 16MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

pop_singular
import iterpop; iterpop.pop_singular
from iterpop import pop_singular

Pop the single element from a list, raising an error if not exactly one element.

from iterpop import pop_singular items = [42] value = pop_singular(items) print(value) # 42
Debug
Known issues
gotchapop_singular expects exactly one element. If the container is empty or has more than one, it raises a ValueError. This is by design, but newcomers may expect a default or None.
fix
Catch ValueError or ensure container length is 1.
affects: >=0.1.0
gotchapop_singular modifies the container in place (like list.pop()). It does not return a copy. If you need the original unchanged, make a copy first.
fix
Use copy before calling: items_copy = items[:]; value = pop_singular(items_copy).
affects: >=0.1.0
Upgrade
Version history
0.4.1latest on PyPI · released Oct 16, 2022
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
iterpop — pip install iterpop · libregistry