iterpop makes popping the value out of a singleton container safe and fun
Project description
iterpop
iterpop makes popping the value out of a singleton container safe and fun
Free software: MIT license
Documentation: https://iterpop.readthedocs.io.
from iterpop import iterpop as ip
# returns 'a'
ip.popsingleton(['a'])
ip.popsingleton({'a'})
ip.popsingleton('a')
# throws
ip.popsingleton([])
ip.popsingleton(set())
ip.popsingleton('')
# throws
ip.popsingleton(['a', 'b'])
ip.popsingleton({'a', 'b'})
ip.popsingleton('ab'})
# returns 'a'
ip.pophomogenous(['a'])
ip.pophomogenous({'a'})
ip.pophomogenous('a')
# also returns 'a'
ip.pophomogenous(['a', 'a'])
ip.pophomogenous('aaa')
ip.pophomogenous('a' for __ in range(100))
# throws
ip.pophomogenous([])
ip.pophomogenous(set())
ip.pophomogenous('')
# throws
ip.pophomogenous(['a', 'b'])
ip.pophomogenous({'a', 'b'})
ip.pophomogenous('ab'})
Credits
This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.
History
0.1.0 (2020-07-06)
First release on PyPI.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
iterpop-0.2.0.tar.gz
(10.4 kB
view hashes)
Built Distribution
Close
Hashes for iterpop-0.2.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3e6f48cca859183996bcebb725f87f2df3e259a06b2db5f94dfa035a90193a21 |
|
MD5 | 2dab0cb95d1d9a8abaef24eb924ed2c2 |
|
BLAKE2b-256 | 468025f64980822f345a3c01c47729ef0bc806f0fd64a6d506ed80d0c4c118b6 |