Though inspired by Perl’s Set::IntSpan, that’s where the similarity stops.
intspansupports only finite sets, and it follows the methods and conventions of Python’s
intspanmethods and operations such as
>=take integer span strings, lists, and sets as arguments, changing facilities that used to take only one item into ones that take multiples, including arguments that are technically string specifications rather than proper
A version of
intspanlistthat does not discard duplicates is under consideration.
String representation and
ranges()method based on Jeff Mercado’s concise answer to this StackOverflow question. Thank you, Jeff!
Successfully packaged for, and tested against, all late-model versions of Python: 2.6, 2.7, 3.2, 3.3, 3.4, and 3.5 pre-release (3.5.0b3) as well as PyPy 2.6.0 (based on 2.7.9) and PyPy3 2.4.0 (based on 3.2.5). Test line coverage 100%.
If you find
intspanuseful, consider buying me a pint and a nice salty pretzel.