14
0
forked from pool/python-bidict

- update to 0.22.0:

- Drop support for Python 3.6, which reached end of life on 2021-12-23
   and is no longer supported by pip as of pip version 22.
   Take advantage of this to reduce bidict's maintenance costs.
 - Use mypy-appeasing explicit re-exports in ``__init__.py``
   (e.g. ``import x as x``)
   so that mypy no longer gives you an implicit re-export error
   if you run it with ``--no-implicit-reexport`` (or ``--strict``)
   against code that imports from :mod:`bidict`.
 - Update the implementations and type annotations of
   :meth:`bidict.BidictBase.keys` and
   :meth:`bidict.BidictBase.values` to make use of the new
   :class:`~bidict.BidictKeysView` type,
   which works a bit better with type checkers.
 - Inverse bidict instances are now computed lazily the first time
   the :attr:`~bidict.BidictBase.inverse` attribute is accessed
   rather than being computed eagerly during initialization.
   (A bidict's backing, inverse, one-way mapping
   is still kept in sync eagerly as any mutations are made,
   to preserve key- and value-uniqueness.)
 - Optimize initializing a bidict with another bidict.
   In a microbenchmark on Python 3.10,
   this now performs over **2x faster**.
 - Optimize updating an empty bidict with another bidict.
   In a microbenchmark on Python 3.10,
   this now performs **60-75% faster**.
 - Optimize :meth:`~bidict.BidictBase.copy`.
   In a microbenchmark on Python 3.10,
   this now performs **10-20x faster**.
 - Optimize rolling back

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-bidict?expand=0&rev=22
This commit is contained in:
2022-09-24 10:41:02 +00:00
committed by Git OBS Bridge
parent 2ad58779bc
commit 3aacdee532
4 changed files with 75 additions and 5 deletions

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:d50bd81fae75e34198ffc94979a0eb0939ff9adb3ef32bcc93a913d8b3e3ed1d
size 406100

3
bidict-0.22.0.tar.gz Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:5c826b3e15e97cc6e615de295756847c282a79b79c5430d3bfc909b1ac9f5bd8
size 197969

View File

@@ -1,3 +1,72 @@
-------------------------------------------------------------------
Sat Sep 24 10:33:36 UTC 2022 - Dirk Müller <dmueller@suse.com>
- update to 0.22.0:
- Drop support for Python 3.6, which reached end of life on 2021-12-23
and is no longer supported by pip as of pip version 22.
Take advantage of this to reduce bidict's maintenance costs.
- Use mypy-appeasing explicit re-exports in ``__init__.py``
(e.g. ``import x as x``)
so that mypy no longer gives you an implicit re-export error
if you run it with ``--no-implicit-reexport`` (or ``--strict``)
against code that imports from :mod:`bidict`.
- Update the implementations and type annotations of
:meth:`bidict.BidictBase.keys` and
:meth:`bidict.BidictBase.values` to make use of the new
:class:`~bidict.BidictKeysView` type,
which works a bit better with type checkers.
- Inverse bidict instances are now computed lazily the first time
the :attr:`~bidict.BidictBase.inverse` attribute is accessed
rather than being computed eagerly during initialization.
(A bidict's backing, inverse, one-way mapping
is still kept in sync eagerly as any mutations are made,
to preserve key- and value-uniqueness.)
- Optimize initializing a bidict with another bidict.
In a microbenchmark on Python 3.10,
this now performs over **2x faster**.
- Optimize updating an empty bidict with another bidict.
In a microbenchmark on Python 3.10,
this now performs **60-75% faster**.
- Optimize :meth:`~bidict.BidictBase.copy`.
In a microbenchmark on Python 3.10,
this now performs **10-20x faster**.
- Optimize rolling back
:ref:`failed updates to a bidict <basic-usage:Updates Fail Clean>`
in the case that the number of items passed to the update call
can be determined to be larger than the bidict being updated.
Previously this rollback was O(n) in the number of items passed.
Now it is O(1), i.e. **unboundedly faster**.
- Optimize :meth:`bidict.BidictBase.__contains__`
(the method called when you run ``key in mybidict``).
In a microbenchmark on Python 3.10,
this now performs over **3-10x faster** in the False case,
and at least **50% faster** in the True case.
- Optimize :meth:`bidict.BidictBase.__eq__`
(the method called when you run ``mybidict == other``).
In a microbenchmark on Python 3.10,
this now performs **15-25x faster** for ordered bidicts,
and **7-12x faster** for unordered bidicts.
- Optimize :meth:`~bidict.BidictBase.equals_order_sensitive`.
In a microbenchmark on Python 3.10,
this now performs **2x faster** for ordered bidicts
and **60-90% faster** for unordered bidicts.
- Optimize the
:class:`~collections.abc.MappingView` objects returned by
:meth:`bidict.OrderedBidict.keys`,
:meth:`bidict.OrderedBidict.values`, and
:meth:`bidict.OrderedBidict.items`
to delegate to backing ``dict_keys`` and ``dict_items``
objects if available, which are much faster in CPython.
For example, in a microbenchmark on Python 3.10,
``orderedbi.items() == d.items()``
now performs **30-50x faster**.
- Fix a bug where
:meth:`bidict.BidictBase.__eq__` was always returning False
rather than :obj:`NotImplemented`
in the case that the argument was not a
:class:`~collections.abc.Mapping`,
defeating the argument's own ``__eq__()`` if implemented.
-------------------------------------------------------------------
Sun Sep 5 18:06:07 UTC 2021 - Martin Hauke <mardnh@gmx.de>

View File

@@ -1,7 +1,7 @@
#
# spec file for package python-bidict
#
# Copyright (c) 2021 SUSE LLC
# Copyright (c) 2022 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -19,12 +19,13 @@
%define skip_python2 1
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-bidict
Version: 0.21.3
Version: 0.22.0
Release: 0
Summary: Bidirectional map implementation for Python
License: MPL-2.0
URL: https://github.com/jab/bidict
Source: https://files.pythonhosted.org/packages/source/b/bidict/bidict-%{version}.tar.gz
BuildRequires: %{python_module base >= 3.7}
BuildRequires: %{python_module setuptools}
BuildRequires: fdupes
BuildRequires: python-rpm-macros