-Subset of ``set`` designed to conveniently hold sets of integers. It
-creates them from, and displays them as,
-integer spans (e.g. ``1-3,14,29,92-97``). When iterating over an ``intspan``,
+Subset of ``set`` designed to conveniently hold sets of integers. It creates
+them from, and displays them as, integer spans (e.g. ``1-3,14,29,92-97``). When
+iterating, ``pop()``-ing an item, or converting to a list, ``intspan`` behaves as
+if it were an ordered collection.
The main draw is that this provides a convenient way
to specify ranges--for example, ranges of rows to be processed in a spreadsheet.
optimized for long contiguous runs. For sets of several hundred or thousand
members, you will probably never notice the difference.
-On the other hand, if you're dealing
-with large sets (e.g. with 10,000 or more elements), or doing lots of set operations
+On the other hand, if you're doing lots of processing of
+large sets (e.g. with 100,000 or more elements), or doing lots of set operations
on them (e.g. union, intersection), a data structure based on
lists of ranges, `run length encoding
<http://en.wikipedia.org/wiki/Run-length_encoding>`_, or `Judy arrays
-There are several generally available modules you might want to consider as
-alternatives or supplements. None of them provide (AFAIK) the convenient
+There are several modules you might want to consider as
+alternatives or supplements. AFAIK, none of them provide the convenient
integer span specification that ``intspan`` does, but they have other virtues:
* `cowboy <http://pypi.python.org/pypi/cowboy>`_ provides
* Some ``set`` operations such as ``update()``, ``add()``, ``discard()``, and
``remove()`` take integer span strings as arguments. In some cases this
- changes a method that took one item into one that takes multiple. Not all
+ changes a method that took one item into one that takes multiple. They may
+ also take string specifications of intspans that are not proper ``intspan``
+ objects. But it's not perfectly uniform, and not all
``set`` operations have been so extended.
* String representation based on Jeff Mercado's concise answer to `this