ANN: SortedContainers 1.4.2 released

Grant Jenks grant.jenks at gmail.com
Wed Oct 21 06:06:40 CEST 2015


Announcing the release of SortedContainers version 1.4.2

What is SortedContainers?
-------------------------

SortedContainers is an Apache2-licensed, pure-Python implementation of
sorted list, sorted dict, and sorted set data types that is fast-as-C
implementations with 100% code coverage and hours of stress testing.
The project is fully documented with performance benchmarks and
comparisons to alternative implementations.

What's new in 1.4.2?
--------------------

* Updated docs to warn against editing sorted containers during
  iteration. Don't do it.
* Updated SortedList* comparisons to match Sequence comparison as described in
  CPython Language Reference Section 5.9.
  https://docs.python.org/2/reference/expressions.html
  This also lead to the discovery of a bug in the blist.sortedlist
  implementation (filed as Issue #77 in their bug tracker).
  https://github.com/DanielStutzbach/blist/issues/77
* Updated SortedSet comparison to raise NotImplemented on type mismatch.
* Bug Fix: Fixed reference to self._dict in sorteddict.ValuesView.count.
* Bug Fix: SortedSet.__ior__ now calls `update` rather than `union`.
* Improved performance of SortedList.__getitem__ by 35% for head and tail
  indexing.
* Improved performance of SortedList.pop by 35% by inlining fast-paths of
  internal indexing methods.
* Improved performance of `del sorted_list[:]` by simply calling `clear`.
* Improved performance of `sorted_list[:] = values` by simply calling `clear`
  then `update`.
* Updated SortedListWithKey to inherit directly from SortedList. Removed
  redundant methods. Merged sortedlistwithkey.py into sortedlist.py.
* Updated SortedList to accept a key-argument callable that will dynamically
  return a SortedListWithKey instance.
* Added new __init__ benchmark comparison. SortedContainers is generally 5-10x
  faster than other implementations.
* Added reference to ruamel.ordereddict.sorteddict on performance comparison
  page at http://www.grantjenks.com/docs/sortedcontainers/performance.html
* Removed SortedList._slice in favor of slice.indices.
* Removed SortedList.as_list in favor of `list(sorted_list)`.
* Updated benchmarks using CPython 2.7.10 and CPython 3.4.3. See docs for
  complete version strings.
* Added CPython 3.5 runtime to test frameworks configs.
* Added docs reference to Debian distributions at python-sortedcontainers and
  python3-sortedcontainers.

Links
-----

- Documentation: http://www.grantjenks.com/docs/sortedcontainers/
- Download: https://pypi.python.org/pypi/sortedcontainers
- Source: https://github.com/grantjenks/sorted_containers
- Issues: https://github.com/grantjenks/sorted_containers/issues

This release is mostly backwards-compatible. Please upgrade.


More information about the Python-announce-list mailing list