{"id":23906,"library":"iterpop","title":"iterpop","description":"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.","status":"active","version":"0.4.1","language":"python","source_language":"en","source_url":"https://github.com/mmore500/iterpop","tags":["iterators","containers","pop","safety"],"install":[{"cmd":"pip install iterpop","lang":"bash","label":"Install via pip"}],"dependencies":[],"imports":[{"wrong":"from iterpop import pop_singular","symbol":"pop_singular","correct":"import iterpop; iterpop.pop_singular"}],"quickstart":{"code":"from iterpop import pop_singular\n\nitems = [42]\nvalue = pop_singular(items)\nprint(value)  # 42","lang":"python","description":"Pop the single element from a list, raising an error if not exactly one element."},"warnings":[{"fix":"Catch ValueError or ensure container length is 1.","message":"pop_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.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Use copy before calling: items_copy = items[:]; value = pop_singular(items_copy).","message":"pop_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.","severity":"gotcha","affected_versions":">=0.1.0"}],"env_vars":null,"search_vec":"'0.4.1':22 'avoid':16 'cadenc':26 'check':19 'contain':15,28 'conveni':6 'current':20 'function':7 'iter':27 'iterpop':1,2 'length':18 'low':24 'manual':17 'pop':9,29 'provid':3 'releas':25 'safe':4 'safeti':30 'singl':11 'stabl':23 'valu':12 'version':21","created_at":"2026-05-01T08:10:14.974678+00:00","updated_at":"2026-05-01T08:10:14.974678+00:00","problems":{"verify_error":"Traceback (most recent call last):\n  File \"<string>\", line 1, in <module>\nAttributeError: module 'iterpop' has no attribute 'pop_singular'"},"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"0.4.1","cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/mmore500/iterpop","docs":null,"changelog":null,"pypi":"https://pypi.org/project/iterpop/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["data"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"import_fail","verified_at":"2026-07-03","last_verified":"2026-07-03","next_check":"2026-07-10","install_tag":null}}