Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-jaraco.collections for openSUSE:Factory checked in at 2022-11-10 14:21:24 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-jaraco.collections (Old) and /work/SRC/openSUSE:Factory/.python-jaraco.collections.new.1597 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-jaraco.collections" Thu Nov 10 14:21:24 2022 rev:8 rq:1034615 version:3.7.0 Changes: -------- --- /work/SRC/openSUSE:Factory/python-jaraco.collections/python-jaraco.collections.changes 2022-10-27 13:52:14.643981075 +0200 +++ /work/SRC/openSUSE:Factory/.python-jaraco.collections.new.1597/python-jaraco.collections.changes 2022-11-10 14:21:45.366170252 +0100 @@ -1,0 +2,6 @@ +Tue Nov 8 17:12:30 UTC 2022 - Yogalakshmi Arunachalam <yarunacha...@suse.com> + +- Update to 3.7.0: + * Added RangeMap.left. + +------------------------------------------------------------------- Old: ---- jaraco.collections-3.6.0.tar.gz New: ---- jaraco.collections-3.7.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-jaraco.collections.spec ++++++ --- /var/tmp/diff_new_pack.zKcVkj/_old 2022-11-10 14:21:45.902173286 +0100 +++ /var/tmp/diff_new_pack.zKcVkj/_new 2022-11-10 14:21:45.906173309 +0100 @@ -18,7 +18,7 @@ %define skip_python2 1 Name: python-jaraco.collections -Version: 3.6.0 +Version: 3.7.0 Release: 0 Summary: Tools to work with collections License: MIT ++++++ jaraco.collections-3.6.0.tar.gz -> jaraco.collections-3.7.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jaraco.collections-3.6.0/CHANGES.rst new/jaraco.collections-3.7.0/CHANGES.rst --- old/jaraco.collections-3.6.0/CHANGES.rst 2022-10-23 18:42:12.000000000 +0200 +++ new/jaraco.collections-3.7.0/CHANGES.rst 2022-10-29 11:28:56.000000000 +0200 @@ -1,3 +1,8 @@ +v3.7.0 +====== + +Added ``RangeMap.left``. + v3.6.0 ====== diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jaraco.collections-3.6.0/PKG-INFO new/jaraco.collections-3.7.0/PKG-INFO --- old/jaraco.collections-3.6.0/PKG-INFO 2022-10-23 18:42:50.609867600 +0200 +++ new/jaraco.collections-3.7.0/PKG-INFO 2022-10-29 11:29:36.534370700 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: jaraco.collections -Version: 3.6.0 +Version: 3.7.0 Summary: Collection objects similar to those in stdlib by jaraco Home-page: https://github.com/jaraco/jaraco.collections Author: Jason R. Coombs diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jaraco.collections-3.6.0/jaraco/collections.py new/jaraco.collections-3.7.0/jaraco/collections.py --- old/jaraco.collections-3.6.0/jaraco/collections.py 2022-10-23 18:42:12.000000000 +0200 +++ new/jaraco.collections-3.7.0/jaraco/collections.py 2022-10-29 11:28:56.000000000 +0200 @@ -162,7 +162,7 @@ the sorted list of keys. One may supply keyword parameters to be passed to the sort function used - to sort keys (i.e. cmp [python 2 only], keys, reverse) as sort_params. + to sort keys (i.e. key, reverse) as sort_params. Let's create a map that maps 1-3 -> 'a', 4-6 -> 'b' @@ -215,6 +215,23 @@ >>> r.get(7, 'not found') 'not found' + + One often wishes to define the ranges by their left-most values, + which requires use of sort params and a key_match_comparator. + + >>> r = RangeMap({1: 'a', 4: 'b'}, + ... sort_params=dict(reverse=True), + ... key_match_comparator=operator.ge) + >>> r[1], r[2], r[3], r[4], r[5], r[6] + ('a', 'a', 'a', 'b', 'b', 'b') + + That wasn't nearly as easy as before, so an alternate constructor + is provided: + + >>> r = RangeMap.left({1: 'a', 4: 'b', 7: RangeMap.undefined_value}) + >>> r[1], r[2], r[3], r[4], r[5], r[6] + ('a', 'a', 'a', 'b', 'b', 'b') + """ def __init__(self, source, sort_params={}, key_match_comparator=operator.le): @@ -222,6 +239,12 @@ self.sort_params = sort_params self.match = key_match_comparator + @classmethod + def left(cls, source): + return cls( + source, sort_params=dict(reverse=True), key_match_comparator=operator.ge + ) + def __getitem__(self, item): sorted_keys = sorted(self.keys(), **self.sort_params) if isinstance(item, RangeMap.Item): @@ -256,7 +279,7 @@ return (sorted_keys[RangeMap.first_item], sorted_keys[RangeMap.last_item]) # some special values for the RangeMap - undefined_value = type(str('RangeValueUndefined'), (object,), {})() + undefined_value = type(str('RangeValueUndefined'), (), {})() class Item(int): "RangeMap Item" @@ -428,7 +451,7 @@ return jaraco.text.FoldedCase(key) -class DictAdapter(object): +class DictAdapter: """ Provide a getitem interface for attributes of an object. @@ -447,7 +470,7 @@ return getattr(self.object, name) -class ItemsAsAttributes(object): +class ItemsAsAttributes: """ Mix-in class to enable a mapping object to provide items as attributes. @@ -850,7 +873,7 @@ return (self[name] for name in self.names) -class Everything(object): +class Everything: """ A collection "containing" every possible thing. @@ -891,7 +914,7 @@ self.data = data -class Least(object): +class Least: """ A value that is always lesser than any other @@ -923,7 +946,7 @@ __gt__ = __ge__ -class Greatest(object): +class Greatest: """ A value that is always greater than any other diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jaraco.collections-3.6.0/jaraco.collections.egg-info/PKG-INFO new/jaraco.collections-3.7.0/jaraco.collections.egg-info/PKG-INFO --- old/jaraco.collections-3.6.0/jaraco.collections.egg-info/PKG-INFO 2022-10-23 18:42:50.000000000 +0200 +++ new/jaraco.collections-3.7.0/jaraco.collections.egg-info/PKG-INFO 2022-10-29 11:29:36.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: jaraco.collections -Version: 3.6.0 +Version: 3.7.0 Summary: Collection objects similar to those in stdlib by jaraco Home-page: https://github.com/jaraco/jaraco.collections Author: Jason R. Coombs