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 early 2017 versions of Python including latest builds of 2.6, 2.7, 3.2, 3.3, 3.4, 3.5, and 3.6, as well as latest PyPy and PyPy3. Test line coverage 100%.
If you find
intspanuseful, consider buying me a pint and a nice salty pretzel.