* Fix a regression in 0.23.0 that could defeat type inference
of a bidict's key type and value type when running in Python
3.8 or 3.9. :issue:`310`
* Primarily, this release simplifies bidict by removing minor
features that are no longer necessary or that have little to
no apparent usage, and it also includes some performance
optimizations.
* Specifically, initializing or updating a bidict is now up to
70% faster in microbenchmarks.
* The changes in this release will also make it easier to
maintain and improve bidict in the future, including further
potential performance optimizations.
* It also contains several other improvements.
* Drop support for Python 3.7, which reached end of life on
2023-06-27, and take advantage of features available in
Python 3.8+.
* Drop support for Python 3.7, which reached end of life on
2023-06-27, and take advantage of features available in
Python 3.8+.
* Remove FrozenOrderedBidict now that Python 3.7 is no longer
supported. :class:`~bidict.frozenbidict` now provides
everything that FrozenOrderedBidict provided (including
:class:`reversibility <collections.abc.Reversible>`) on all
supported Python versions, but with less space overhead.
* Remove FrozenOrderedBidict now that Python 3.7 is no longer
supported. :class:`~bidict.frozenbidict` now provides
everything that FrozenOrderedBidict provided (including
:class:`reversibility <collections.abc.Reversible>`) on all
supported Python versions, but with less space overhead.
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-bidict?expand=0&rev=33
576 lines
27 KiB
Plaintext
576 lines
27 KiB
Plaintext
-------------------------------------------------------------------
|
||
Fri Mar 22 19:53:11 UTC 2024 - Dirk Müller <dmueller@suse.com>
|
||
|
||
- update to 0.23.1:
|
||
* Fix a regression in 0.23.0 that could defeat type inference
|
||
of a bidict's key type and value type when running in Python
|
||
3.8 or 3.9. :issue:`310`
|
||
* Primarily, this release simplifies bidict by removing minor
|
||
features that are no longer necessary or that have little to
|
||
no apparent usage, and it also includes some performance
|
||
optimizations.
|
||
* Specifically, initializing or updating a bidict is now up to
|
||
70% faster in microbenchmarks.
|
||
* The changes in this release will also make it easier to
|
||
maintain and improve bidict in the future, including further
|
||
potential performance optimizations.
|
||
* It also contains several other improvements.
|
||
* Drop support for Python 3.7, which reached end of life on
|
||
2023-06-27, and take advantage of features available in
|
||
Python 3.8+.
|
||
* Drop support for Python 3.7, which reached end of life on
|
||
2023-06-27, and take advantage of features available in
|
||
Python 3.8+.
|
||
* Remove FrozenOrderedBidict now that Python 3.7 is no longer
|
||
supported. :class:`~bidict.frozenbidict` now provides
|
||
everything that FrozenOrderedBidict provided (including
|
||
:class:`reversibility <collections.abc.Reversible>`) on all
|
||
supported Python versions, but with less space overhead.
|
||
* Remove FrozenOrderedBidict now that Python 3.7 is no longer
|
||
supported. :class:`~bidict.frozenbidict` now provides
|
||
everything that FrozenOrderedBidict provided (including
|
||
:class:`reversibility <collections.abc.Reversible>`) on all
|
||
supported Python versions, but with less space overhead.
|
||
* Remove namedbidict due to low usage.
|
||
* Remove namedbidict due to low usage.
|
||
* Remove the kv field of :class:`~bidict.OnDup` which specified
|
||
the :class:`~bidict.OnDupAction` to take in the case of
|
||
:ref:`basic-usage:key and value duplication`. The
|
||
:attr:`~bidict.OnDup.val` field now specifies the action to
|
||
take in the case of :ref:`basic-usage:key and value
|
||
duplication` as well as :ref:`just value duplication <basic-
|
||
usage:values must be unique>`.
|
||
* Remove the kv field of :class:`~bidict.OnDup` which specified
|
||
the :class:`~bidict.OnDupAction` to take in the case of
|
||
:ref:`basic-usage:key and value duplication`. The
|
||
:attr:`~bidict.OnDup.val` field now specifies the action to
|
||
take in the case of :ref:`basic-usage:key and value
|
||
duplication` as well as :ref:`just value duplication <basic-
|
||
usage:values must be unique>`.
|
||
* Improve type hints for the :attr:`~bidict.BidictBase.inv`
|
||
shortcut alias for :attr:`~bidict.BidictBase.inverse`.
|
||
* Improve type hints for the :attr:`~bidict.BidictBase.inv`
|
||
shortcut alias for :attr:`~bidict.BidictBase.inverse`.
|
||
* Fix a bug where calls like bidict(None), bi.update(False),
|
||
etc. would fail to raise a :class:`TypeError`.
|
||
* Fix a bug where calls like bidict(None), bi.update(False),
|
||
etc. would fail to raise a :class:`TypeError`.
|
||
* All :meth:`~bidict.BidictBase.__init__`,
|
||
:meth:`~bidict.MutableBidict.update`, and related methods now
|
||
handle SupportsKeysAndGetItem objects that are not
|
||
:class:`~collections.abc.Mapping`s the same way that
|
||
MutableMapping.update() does, before falling back to handling
|
||
the provided object as an iterable of pairs.
|
||
* All :meth:`~bidict.BidictBase.__init__`,
|
||
:meth:`~bidict.MutableBidict.update`, and related methods now
|
||
handle SupportsKeysAndGetItem objects that are not
|
||
:class:`~collections.abc.Mapping`s the same way that
|
||
MutableMapping.update() does, before falling back to handling
|
||
the provided object as an iterable of pairs.
|
||
* The :func:`repr` of ordered bidicts now matches that of
|
||
regular bidicts, e.g. OrderedBidict({1: 1}) rather than
|
||
OrderedBidict([(1, 1)]). (Accordingly, the
|
||
bidict.__repr_delegate__ field has been removed now that it's
|
||
no longer needed.) This tracks with the change to
|
||
:class:`collections.OrderedDict`'s :func:`repr` in Python
|
||
3.12.
|
||
* The :func:`repr` of ordered bidicts now matches that of
|
||
regular bidicts, e.g. OrderedBidict({1: 1}) rather than
|
||
OrderedBidict([(1, 1)]).
|
||
* (Accordingly, the bidict.__repr_delegate__ field has been
|
||
removed now that it's no longer needed.)
|
||
* This tracks with the change to
|
||
:class:`collections.OrderedDict`'s :func:`repr` in Python
|
||
3.12.
|
||
* Test with Python 3.12 in CI. Note: Older versions of bidict
|
||
also support Python 3.12, even though they don't explicitly
|
||
declare support for it.
|
||
* Test with Python 3.12 in CI.
|
||
* Note: Older versions of bidict also support Python 3.12, even
|
||
though they don't explicitly declare support for it.
|
||
* Drop use of Trove classifiers that declare support for
|
||
specific Python versions in package metadata.
|
||
* Drop use of Trove classifiers that declare support for
|
||
specific Python versions in package metadata.
|
||
- drop support-python-312.patch (upstream)
|
||
|
||
-------------------------------------------------------------------
|
||
Tue Feb 6 05:38:41 UTC 2024 - Steve Kowalik <steven.kowalik@suse.com>
|
||
|
||
- Add patch support-python-312.patch:
|
||
* Cope with different TypeError raised.
|
||
- No more greedy globs in %files.
|
||
|
||
-------------------------------------------------------------------
|
||
Mon Jan 15 13:44:03 UTC 2024 - Antonio Larrosa <alarrosa@suse.com>
|
||
|
||
- Remove BuildRequires that aren't really used:
|
||
sortedcollections and sortedcontainers
|
||
|
||
-------------------------------------------------------------------
|
||
Fri Dec 1 16:43:23 UTC 2023 - Antonio Larrosa <alarrosa@suse.com>
|
||
|
||
- Add %{?sle15_python_module_pythons}
|
||
|
||
-------------------------------------------------------------------
|
||
Fri Feb 10 10:31:11 UTC 2023 - Dirk Müller <dmueller@suse.com>
|
||
|
||
- update to 0.22.1:
|
||
* Only include the source code in the source distribution. This
|
||
reduces the size of the source distribution from ~200kB to ~30kB.
|
||
* Fix the return type hint of bidict.inverted() to return an
|
||
Iterator, rather than an Iterable
|
||
|
||
-------------------------------------------------------------------
|
||
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>
|
||
|
||
- Update to version 0.21.3
|
||
* All bidicts now provide the equals_order_sensitive() method,
|
||
not just bidict.OrderedBidicts.
|
||
* Since support for Python < 3.6 was dropped in v0.21.0,
|
||
non-Ordered bidicts preserve a deterministic ordering on all
|
||
supported Python versions, so all bidicts can now provide
|
||
equals_order_sensitive().
|
||
* Take better advantage of the fact that dicts are reversible
|
||
in Python 3.8+. This allows even non-Ordered bidicts to
|
||
efficiently provide a __reversed__() implementation, which
|
||
they now do. As a result, if you are using Python 3.8+,
|
||
frozenbidict now gives you everything that
|
||
FrozenOrderedBidict gives you with less space overhead.
|
||
* Drop setuptools_scm as a setup_requires dependency.
|
||
* Remove the bidict.__version_info__ attribute.
|
||
|
||
-------------------------------------------------------------------
|
||
Wed May 26 07:30:55 UTC 2021 - Axel Braun <axel.braun@gmx.de>
|
||
|
||
- Update to version 0.21.2
|
||
* Include `py.typed <https://www.python.org/dev/peps/pep-0561/#packaging-type-information>`__
|
||
file to mark :mod:`bidict` as type hinted.
|
||
|
||
-------------------------------------------------------------------
|
||
Tue Sep 1 04:48:00 UTC 2020 - Steve Kowalik <steven.kowalik@suse.com>
|
||
|
||
- Update to 0.21.0:
|
||
* bidict now provides type hints
|
||
* Add bidict.MutableBidirectionalMapping ABC
|
||
* Drop Python 3.5 support
|
||
* Remove bidict.compat module
|
||
* Remove APIs deprecated in previous releases
|
||
- Drop dont-limit-versions.patch, included upstream
|
||
|
||
-------------------------------------------------------------------
|
||
Tue Aug 18 18:56:46 UTC 2020 - Matej Cepl <mcepl@suse.com>
|
||
|
||
- Add dont-limit-versions.patch … don't limit the upper
|
||
version of setuptools_scm to be used.
|
||
|
||
-------------------------------------------------------------------
|
||
Fri Jan 17 16:50:46 UTC 2020 - Marketa Calabkova <mcalabkova@suse.com>
|
||
|
||
- update to 0.19.0
|
||
* Drop support for Python 2 as promised in v0.18.2.
|
||
* Deprecate bidict.OVERWRITE and bidict.IGNORE. A UserWarning will now be emitted if these are used.
|
||
* Rename DuplicationPolicy to OnDupAction (and implement it via an Enum).
|
||
* No longer use __all__ in bidict’s __init__.py.
|
||
* Improve validation of names passed to namedbidict().
|
||
|
||
-------------------------------------------------------------------
|
||
Fri Sep 13 11:22:42 UTC 2019 - Tomáš Chvátal <tchvatal@suse.com>
|
||
|
||
- Update to 0.18.2:
|
||
* Warn that Python 2 support will be dropped in a future release when Python 2 is detected.
|
||
* Fix a regression introduced by the memory optimizations added in 0.15.0 which caused deepcopied and unpickled bidicts to have their inverses set incorrectly. #94
|
||
|
||
-------------------------------------------------------------------
|
||
Sun Feb 10 11:49:33 UTC 2019 - John Vandenberg <jayvdb@gmail.com>
|
||
|
||
- Remove unused build dependencies
|
||
- Add export LANG=en_US.UTF-8
|
||
- Add docs/*.rst to %doc
|
||
- Update to v0.18.0
|
||
+ Rename BidirectionalMapping.inv to BidirectionalMapping.inverse
|
||
and make BidictBase.inv an alias.
|
||
+ BidirectionalMapping.__subclasshook__ now requires an ``inverse``
|
||
attribute rather than an inv attribute for a class to qualify as a
|
||
virtual subclass.
|
||
This breaking change is expected to affect few if any users.
|
||
+ Add Python 2/3-compatible compat.collections_abc alias.
|
||
+ Drop support for Python 3.4
|
||
- from v0.17.5
|
||
+ Remove the ``__delegate__`` instance attribute added in the previous release.
|
||
Instead of checking ``self.__delegate__`` and delegating accordingly
|
||
each time a possibly-delegating method is called,
|
||
revert back to using "delegated-to-fwdm" mixin classes
|
||
now found in bidict._delegating_mixins, and resurrect a mutable bidict
|
||
parent class that omits the mixins
|
||
+ Rename __repr_delegate__ to BidictBase._repr_delegate
|
||
- Update to v0.17.4
|
||
+ `~bidict.OrderedBidict` optimizations and code improvements.
|
||
+ Refactor proxied- (i.e. delegated-) to-_fwdm logic
|
||
for better composability and interoperability.
|
||
+ Change ``__repr_delegate__`` to simply take a type like dict or list
|
||
+ Upgrade to latest major release of sortedcontainers
|
||
+ bidict.compat.{view,iter}{keys,values,items} on Python 2
|
||
no longer assumes the target object implements these methods,
|
||
as they're not actually part of the collections.abc.Mapping interface,
|
||
and provides fallback implementations when the methods are unavailable.
|
||
- Update to v0.17.3
|
||
+ Improve packaging by adding a pyproject.toml
|
||
+ Drop pytest-runner and support for running tests via setup.py test
|
||
|
||
-------------------------------------------------------------------
|
||
Tue Dec 4 12:46:05 UTC 2018 - Matej Cepl <mcepl@suse.com>
|
||
|
||
- Remove superfluous devel dependency for noarch package
|
||
|
||
-------------------------------------------------------------------
|
||
Sun Jul 29 11:34:43 UTC 2018 - jengelh@inai.de
|
||
|
||
- Specify summary with a bit more detail.
|
||
|
||
-------------------------------------------------------------------
|
||
Wed May 9 03:36:16 UTC 2018 - toddrme2178@gmail.com
|
||
|
||
- Update to version 0.17.2
|
||
+ Speedups and memory usage improvements
|
||
- Use less memory in the linked lists that back
|
||
:class:`~bidict.OrderedBidict`\s
|
||
by storing node data unpacked
|
||
rather than in (key, value) tuple objects.
|
||
- Update to version 0.17.1
|
||
+ Bugfix Release
|
||
- Fix a regression in 0.17.0 that could cause erroneous behavior
|
||
when updating items of an :class:`~bidict.Orderedbidict`'s inverse,
|
||
e.g. ``some_ordered_bidict.inv[foo] = bar``.
|
||
- Update to version 0.17.0
|
||
+ Speedups and memory usage improvements
|
||
- Pass
|
||
:meth:`~bidict.bidict.keys`,
|
||
:meth:`~bidict.bidict.values`, and
|
||
:meth:`~bidict.bidict.items` calls
|
||
(as well as their ``iter*`` and ``view*`` counterparts on Python 2)
|
||
through to the backing ``_fwdm`` and ``_invm`` dicts
|
||
so that they run as fast as possible
|
||
(i.e. at C speed on CPython),
|
||
rather than using the slower implementations
|
||
inherited from :class:`collections.abc.Mapping`.
|
||
- Use weakrefs in the linked lists that back
|
||
:class:`~bidict.OrderedBidict`\s
|
||
to avoid creating strong reference cycles.
|
||
+ Misc
|
||
- Add :attr:`bidict.__version_info__` attribute
|
||
to complement :attr:`bidict.__version__`.
|
||
- Update to version 0.16.0
|
||
+ Speedups and memory usage improvements
|
||
- Minor code and efficiency improvements to
|
||
:func:`~bidict.inverted` and
|
||
:func:`~bidict._util._iteritems_args_kw`
|
||
(formerly ``bidict.pairs()``).
|
||
+ Minor Breaking API Changes
|
||
- Rename ``bidict.pairs()`` → :func:`bidict._util._iteritems_args_kw`.
|
||
- Update to version 0.15.0
|
||
+ Speedups and memory usage improvements
|
||
- Use :ref:`slots` to speed up bidict attribute access and reduce memory usage.
|
||
On Python 3,
|
||
instantiating a large number of bidicts now uses ~57% the amount of memory
|
||
that it used before,
|
||
and on Python 2 only ~33% the amount of memory that it used before,
|
||
in a simple but representative
|
||
`benchmark <https://github.com/jab/bidict/pull/56#issuecomment-368203591>`__.
|
||
- Use weakrefs to refer to a bidict's inverse internally,
|
||
no longer creating a strong reference cycle.
|
||
Memory for a bidict that you create can now be reclaimed
|
||
in CPython as soon as you no longer hold any references to it,
|
||
rather than having to wait for the next garbage collection.
|
||
See the new
|
||
:ref:`addendum:\:attr\:\`~bidict.BidictBase.inv\` Avoids Reference Cycles`
|
||
documentation.
|
||
Fixes `#24 <https://github.com/jab/bidict/issues/20>`__.
|
||
- Make :func:`bidict.BidictBase.__eq__` significantly
|
||
more speed- and memory-efficient when comparing to
|
||
a non-:class:`dict` :class:`~collections.abc.Mapping`.
|
||
(``Mapping.__eq__()``\'s inefficient implementation will now never be used.)
|
||
The implementation is now more reusable as well.
|
||
- Make :func:`bidict.OrderedBidictBase.__iter__` as well as
|
||
equality comparison slightly faster for ordered bidicts.
|
||
+ Minor Bugfixes
|
||
- :func:`~bidict.namedbidict` now verifies that the provided
|
||
``keyname`` and ``valname`` are distinct,
|
||
raising :class:`ValueError` if they are equal.
|
||
- :func:`~bidict.namedbidict` now raises :class:`TypeError`
|
||
if the provided ``base_type``
|
||
is not a :class:`~bidict.BidirectionalMapping`.
|
||
- If you create a custom bidict subclass whose ``_fwdm_cls``
|
||
differs from its ``_invm_cls``
|
||
(as in the ``FwdKeySortedBidict`` example
|
||
from the :ref:`extending:Sorted Bidict Recipes`),
|
||
the inverse bidirectional mapping type
|
||
(with ``_fwdm_cls`` and ``_invm_cls`` swapped)
|
||
is now correctly computed and used automatically
|
||
for your custom bidict's
|
||
:attr:`~bidict.BidictBase.inv` bidict.
|
||
+ Miscellaneous
|
||
- Classes no longer have to provide an ``__inverted__``
|
||
attribute to be considered virtual subclasses of
|
||
:class:`~bidict.BidirectionalMapping`.
|
||
- If :func:`bidict.inverted` is passed
|
||
an object with an ``__inverted__`` attribute,
|
||
it now ensures it is :func:`callable`
|
||
before returning the result of calling it.
|
||
- :func:`~bidict.BidictBase.__repr__` no longer checks for a ``__reversed__``
|
||
method to determine whether to use an ordered or unordered-style repr.
|
||
It now calls the new :func:`~bidict.BidictBase.__repr_delegate__` instead
|
||
(which may be overridden if needed), for better composability.
|
||
+ Minor Breaking API Changes
|
||
- Split back out the :class:`~bidict.BidictBase` class
|
||
from :class:`~bidict.frozenbidict`
|
||
and :class:`~bidict.OrderedBidictBase`
|
||
from :class:`~bidict.FrozenOrderedBidict`,
|
||
reverting the merging of these in 0.14.0.
|
||
Having e.g. ``issubclass(bidict, frozenbidict) == True`` was confusing,
|
||
so this change restores ``issubclass(bidict, frozenbidict) == False``.
|
||
- Rename:
|
||
> ``bidict.BidictBase.fwdm`` → ``._fwdm``
|
||
> ``bidict.BidictBase.invm`` → ``._invm``
|
||
> ``bidict.BidictBase.fwd_cls`` → ``._fwdm_cls``
|
||
> ``bidict.BidictBase.inv_cls`` → ``._invm_cls``
|
||
> ``bidict.BidictBase.isinv`` → ``._isinv``
|
||
Though overriding ``_fwdm_cls`` and ``_invm_cls`` remains supported
|
||
(see :doc:`extending`),
|
||
this is not a common enough use case to warrant public names.
|
||
Most users do not need to know or care about any of these.
|
||
- The :attr:`~bidict.RAISE`,
|
||
:attr:`~bidict.OVERWRITE`, and
|
||
:attr:`~bidict.IGNORE`
|
||
duplication policies are no longer available as attributes of
|
||
:class:`bidict.DuplicationPolicy`,
|
||
and can now only be accessed as attributes of
|
||
the :mod:`bidict` module namespace,
|
||
which was the canonical way to refer to them anyway.
|
||
It is now no longer possible to create an infinite chain like
|
||
``DuplicationPolicy.RAISE.RAISE.RAISE...``
|
||
- Make ``bidict.pairs()`` and :func:`bidict.inverted`
|
||
no longer importable from ``bidict.util``,
|
||
and now only importable from the top-level :mod:`bidict` module.
|
||
(``bidict.util`` was renamed ``bidict._util``.)
|
||
- Pickling ordered bidicts now requires
|
||
at least version 2 of the pickle protocol.
|
||
If you are using Python 3,
|
||
:attr:`pickle.DEFAULT_PROTOCOL` is 3 anyway,
|
||
so this will not affect you.
|
||
However if you are using in Python 2,
|
||
:attr:`~pickle.DEFAULT_PROTOCOL` is 0,
|
||
so you must now explicitly specify the version
|
||
in your :func:`pickle.dumps` calls,
|
||
e.g. ``pickle.dumps(ob, 2)``.
|
||
- Update to version 0.14.2
|
||
- Make initializing (or updating an empty bidict) from only another
|
||
:class:`~bidict.BidirectionalMapping`
|
||
more efficient by skipping unnecessary duplication checking.
|
||
- Fix accidental ignoring of specified ``base_type`` argument
|
||
when (un)pickling a :func:`~bidict.namedbidict`.
|
||
- Fix incorrect inversion of
|
||
``some_named_bidict.inv.<fwdname>_for`` and
|
||
``some_named_bidict.inv.<invname>_for``.
|
||
- Only warn when an unsupported Python version is detected
|
||
(e.g. Python < 2.7) rather than raising :class:`AssertionError`.
|
||
- Update to version 0.14.1
|
||
- Fix a bug introduced in 0.14.0 where hashing a
|
||
:class:`~bidict.frozenbidict`\’s inverse
|
||
(e.g. ``f = frozenbidict(); {f.inv: '...'}``)
|
||
would cause an ``AttributeError``.
|
||
- Fix a bug introduced in 0.14.0 for Python 2 users
|
||
where attempting to call ``viewitems()``
|
||
would cause a ``TypeError``.
|
||
Thanks Richard Sanger for
|
||
`reporting <https://github.com/jab/bidict/issues/48>`__.
|
||
- Update to version 0.14.0 (2017-11-20)
|
||
- Fix a bug where :class:`~bidict.bidict`\’s
|
||
default *on_dup_kv* policy was set to :attr:`~bidict.RAISE`,
|
||
rather than matching whatever *on_dup_val* policy was in effect
|
||
as was :ref:`documented <basic-usage:Key and Value Duplication>`.
|
||
- Fix a bug that could happen when using Python's optimization (``-O``) flag
|
||
that could leave an ordered bidict in an inconsistent state
|
||
when dealing with duplicated, overwritten keys or values.
|
||
If you do not use optimizations
|
||
(specifically, skipping ``assert`` statements),
|
||
this would not have affected you.
|
||
- Fix a bug introduced by the optimizations in 0.13.0 that could cause
|
||
a frozen bidict that compared equal to another mapping
|
||
to have a different hash value from the other mapping,
|
||
violating Python's object model.
|
||
This would only have affected you if you were inserting a
|
||
frozen bidict and some other immutable mapping that it compared equal to
|
||
into the same set or mapping.
|
||
- Add :meth:`~bidict.OrderedBidictBase.equals_order_sensitive`.
|
||
- Reduce the memory usage of ordered bidicts.
|
||
- Make copying of ordered bidicts faster.
|
||
- Improvements to tests and CI, including:
|
||
> Test on Windows
|
||
> Test with PyPy3
|
||
> Test with CPython 3.7-dev
|
||
> Test with optimization flags
|
||
> Require pylint to pass
|
||
+ Breaking API Changes
|
||
- Rename:
|
||
> ``orderedbidict`` → :class:`~bidict.OrderedBidict`
|
||
> ``frozenorderedbidict`` → :class:`~bidict.FrozenOrderedBidict`
|
||
so that these now match the case of :class:`collections.OrderedDict`.
|
||
- The names of the
|
||
:class:`~bidict.bidict`,
|
||
:func:`~bidict.namedbidict`, and
|
||
:class:`~bidict.frozenbidict` classes
|
||
have been retained as all-lowercase
|
||
so that they continue to match the case of
|
||
:class:`dict`, :func:`~collections.namedtuple`, and
|
||
:class:`frozenset`, respectively.
|
||
- The ``ON_DUP_VAL`` duplication policy value for *on_dup_kv* has been removed.
|
||
Use ``None`` instead.
|
||
- Merge :class:`~bidict.frozenbidict` and ``BidictBase``
|
||
together and remove ``BidictBase``.
|
||
:class:`~bidict.frozenbidict`
|
||
is now the concrete base class that all other bidict types derive from.
|
||
See the updated :ref:`other-bidict-types:Bidict Types Diagram`.
|
||
- Merge :class:`~bidict.frozenbidict` and ``FrozenBidictBase``
|
||
together and remove ``FrozenBidictBase``.
|
||
See the updated :ref:`other-bidict-types:Bidict Types Diagram`.
|
||
- Merge ``frozenorderedbidict`` and ``OrderedBidictBase`` together
|
||
into a single :class:`~bidict.FrozenOrderedBidict`
|
||
class and remove ``OrderedBidictBase``.
|
||
:class:`~bidict.OrderedBidict` now extends
|
||
:class:`~bidict.FrozenOrderedBidict`
|
||
to add mutable behavior.
|
||
See the updated :ref:`other-bidict-types:Bidict Types Diagram`.
|
||
- Make :meth:`~bidict.OrderedBidictBase.__eq__`
|
||
always perform an order-insensitive equality test,
|
||
even if the other mapping is ordered.
|
||
Previously,
|
||
:meth:`~bidict.OrderedBidictBase.__eq__`
|
||
was only order-sensitive for other ``OrderedBidictBase`` subclasses,
|
||
and order-insensitive otherwise.
|
||
Use the new :meth:`~bidict.OrderedBidictBase.equals_order_sensitive`
|
||
method for order-sensitive equality comparison.
|
||
- ``orderedbidict._should_compare_order_sensitive()`` has been removed.
|
||
- ``frozenorderedbidict._HASH_NITEMS_MAX`` has been removed.
|
||
Since its hash value must be computed from all contained items
|
||
(so that hash results are consistent with
|
||
equality comparisons against unordered mappings),
|
||
the number of items that influence the hash value should not be limitable.
|
||
- ``frozenbidict._USE_ITEMSVIEW_HASH`` has been removed, and
|
||
``frozenbidict.compute_hash()``
|
||
now uses ``collections.ItemsView._hash()`` to compute the hash always,
|
||
not just when running on PyPy.
|
||
Override ``frozenbidict.compute_hash()``
|
||
to return ``hash(frozenset(iteritems(self)))``
|
||
if you prefer the old default behavior on CPython,
|
||
which takes linear rather than constant space,
|
||
but which uses the ``frozenset_hash`` routine
|
||
(implemented in ``setobject.c``)
|
||
rather than the pure Python ``ItemsView._hash()`` routine.
|
||
- ``loosebidict`` and ``looseorderedbidict`` have been removed.
|
||
A simple recipe to implement equivalents yourself is now given in
|
||
:ref:`extending:OverwritingBidict Recipe`.
|
||
- Rename ``FrozenBidictBase._compute_hash()`` →
|
||
``frozenbidict.compute_hash()``.
|
||
- Rename ``DuplicationBehavior`` →
|
||
:class:`~bidict.DuplicationPolicy`.
|
||
- Rename:
|
||
> ``bidict.BidictBase._fwd_class`` → ``.fwd_cls``
|
||
> ``bidict.BidictBase._inv_class`` → ``.inv_cls``
|
||
> ``bidict.BidictBase._on_dup_key`` → :attr:`~bidict.BidictBase.on_dup_key`
|
||
> ``bidict.BidictBase._on_dup_val`` → :attr:`~bidict.BidictBase.on_dup_val`
|
||
> ``bidict.BidictBase._on_dup_kv`` → :attr:`~bidict.BidictBase.on_dup_kv`
|
||
- Use license tag
|
||
|
||
-------------------------------------------------------------------
|
||
Wed Oct 18 16:42:09 UTC 2017 - toddrme2178@gmail.com
|
||
|
||
- Implement single-spec version
|
||
- Update to 0.13.1
|
||
* See changelog at https://bidict.readthedocs.io/en/v0.13.1/changelog.html
|
||
|
||
-------------------------------------------------------------------
|
||
Sun Jun 14 16:46:44 UTC 2015 - arun@gmx.de
|
||
|
||
- update to version 0.9.0:
|
||
* Add a Changelog! Also a Contributors' Guide, Gitter chat room, and
|
||
other community-oriented improvements
|
||
* Adopt Pytest (thanks Tom Viner and Adopt Pytest Month)
|
||
* Add property-based tests via hypothesis
|
||
* Other code, tests, and docs improvements
|
||
|
||
-------------------------------------------------------------------
|
||
Thu Mar 5 10:20:47 UTC 2015 - toddrme2178@gmail.com
|
||
|
||
- Initial version
|
||
|