Repository: mlenzen/collections-extended

Issue:
Duplicate history in change log

Discussion:

Patch:
diff --git a/HISTORY.rst b/HISTORY.rst
index 7eeb864..d46eb66 100644
--- a/HISTORY.rst
+++ b/HISTORY.rst
@@ -3,64 +3,29 @@
 Change Log
 ==========
 
-2.0.0 - 2021-08-23
+2.0.1 - 2022-??-??
 ------------------
 
-Breaking Changes
-""""""""""""""""
+* Added Python 3.10 to tests & classifiers
+* Added equality testing support to MappedRange
+
+2.0.0 - 2021-08-23
+------------------
 
 * Drop support for Python 2.7, 3.4 & 3.5
-* When multiplying bags, the cartesian product creates a tuple instead of adding
-  the elements.
 * bags no longer inherit from Set
   * can no longer compare as equal to Sets
 * Rename and expose bag and set base classes
   * `_basebag` -> :class:`Bag`
   * `_basesetlist` -> :class:`SetList`
-
-Added
-"""""
-
-* Added :class:`IndexedDict`
-* Improve efficiency for large bag operations
-* Add :meth:`setlist.swap`
-* Add :meth:`bag.count`, :class:`CountsView` & :class:`UniqueElementsView`
-* Add :meth:`bag.issubset` and :meth:`issuperset`
-* Add support for Python 3.8 & 3.9
-* Add :class:`Sentinel`
-* Make :class:`MappedRange` a class instead of a namedtuple
-* Add change log
-
-Fixed
-"""""
-
 * tuples passed to the bijection constructor must have len == 2, not >= 2
 
-Deprecated
-""""""""""
-
-Removed
-"""""""
-
 1.0.3 - 2019-11-23
 ------------------
 
-Breaking Changes
-""""""""""""""""
-
 * Drop support for Python 2.6 & 3.3
-
 * When multiplying bags, the cartesian product creates a tuple instead of adding
   the elements.
-* bags no longer inherit from Set
-  * can no longer compare as equal to Sets
-* Rename and expose bag and set base classes
-  * `_basebag` -> :class:`Bag`
-  * `_basesetlist` -> :class:`SetList`
-
-Added
-"""""
-
 * Added :class:`IndexedDict`
 * Improve efficiency for large bag operations
 * Add :meth:`setlist.swap`
@@ -71,15 +36,6 @@ Added
 * Make :class:`MappedRange` a class instead of a namedtuple
 * Add change log
 
-Fixed
-"""""
-
-Deprecated
-""""""""""
-
-Removed
-"""""""
-
 1.0.2 - 2018-06-30
 ------------------
 
diff --git a/collections_extended/bags.py b/collections_extended/bags.py
index 5d5b9eb..d4a5eef 100644
--- a/collections_extended/bags.py
+++ b/collections_extended/bags.py
@@ -203,7 +203,7 @@ class Bag(Collection):
 	def counts(self):
 		"""Return a view of the unique elements in self and their counts.
 
-		.. versionadded:: 1.1
+		.. versionadded:: 1.0.3
 		"""
 		return CountsView(self)
 
diff --git a/collections_extended/indexed_dict.py b/collections_extended/indexed_dict.py
index 4ac6d47..eca8663 100644
--- a/collections_extended/indexed_dict.py
+++ b/collections_extended/indexed_dict.py
@@ -1,6 +1,6 @@
 """IndexedDict class definition.
 
-.. versionadded:: 1.1
+.. versionadded:: 1.0.3
 """
 from collections.abc import MutableMapping
 
@@ -38,7 +38,7 @@ class IndexedDict(MutableMapping):
 
 		If no value is found, return `default` (`None` by default).
 
-		.. deprecated :: 1.1
+		.. deprecated :: 1.0.3
 
 		The `d` parameter has been renamed `default`. `d` will be removed in
 		some future version.
@@ -91,7 +91,7 @@ class IndexedDict(MutableMapping):
 
 		This is generally O(N) unless removing last item, then O(1).
 
-		.. deprecated :: 1.1
+		.. deprecated :: 1.0.3
 
 		The `d` parameter has been renamed `default`. `d` will be removed in
 		some future version.
diff --git a/collections_extended/range_map.py b/collections_extended/range_map.py
index cb4c0b4..b56c106 100644
--- a/collections_extended/range_map.py
+++ b/collections_extended/range_map.py
@@ -47,6 +47,12 @@ class MappedRange:
 			value=self.value,
 			)
 
+	def __eq__(self, other):
+		if isinstance(other, MappedRange):
+			return (self.start, self.stop, self.value) ==\
+				(other.start, other.stop, other.value)
+		return False
+
 
 class RangeMapView(Collection):
 	"""Base class for views of RangeMaps."""
diff --git a/collections_extended/setlists.py b/collections_extended/setlists.py
index 9943a66..5e4e574 100644
--- a/collections_extended/setlists.py
+++ b/collections_extended/setlists.py
@@ -584,7 +584,7 @@ class setlist(SetList, MutableSequence, MutableSet):
 	def swap(self, i, j):
 		"""Swap the values at indices i & j.
 
-		.. versionadded:: 1.1
+		.. versionadded:: 1.0.3
 		"""
 		i = self._fix_neg_index(i)
 		j = self._fix_neg_index(j)


Test patch:
diff --git a/tests/test_range_map.py b/tests/test_range_map.py
index 26dba10..990677c 100644
--- a/tests/test_range_map.py
+++ b/tests/test_range_map.py
@@ -555,3 +555,8 @@ class TestMappedRange:
 		assert v1 == 0
 		assert v2 == 1
 		assert v3 == 'a'
+
+	def test_equality(self):
+		assert MappedRange(0, 1, 'a') == MappedRange(0, 1, 'a')
+		assert not MappedRange(0, 1, 'a') is MappedRange(0, 1, 'a')
+		assert MappedRange(0, 1, 'a') != MappedRange(None, 1, 'a')