2018-04-19 08:22:07 +00:00
|
|
|
|
.. Forward declarations for all the custom interpreted text roles that
|
|
|
|
|
Sphinx defines and that are used below. This helps Sphinx-unaware tools
|
|
|
|
|
(e.g. rst2html, PyPI's and GitHub's renderers, etc.).
|
|
|
|
|
.. role:: doc
|
|
|
|
|
.. role:: ref
|
|
|
|
|
|
|
|
|
|
|
2016-06-28 04:05:22 +00:00
|
|
|
|
Changelog
|
|
|
|
|
=========
|
|
|
|
|
|
2018-04-06 04:28:44 +00:00
|
|
|
|
Release Notifications
|
|
|
|
|
---------------------
|
|
|
|
|
|
|
|
|
|
.. duplicated in README.rst
|
|
|
|
|
(would use `.. include::` but GitHub doesn't understand it)
|
|
|
|
|
|
|
|
|
|
.. image:: https://img.shields.io/badge/libraries.io-subscribe-5BC0DF.svg
|
|
|
|
|
:target: https://libraries.io/pypi/bidict
|
|
|
|
|
:alt: Follow on libraries.io
|
|
|
|
|
|
2020-01-11 03:31:17 +00:00
|
|
|
|
Tip: Subscribe to releases
|
|
|
|
|
`on GitHub <https://github.blog/changelog/2018-11-27-watch-releases/>`__ or
|
|
|
|
|
`libraries.io <https://libraries.io/pypi/bidict>`__
|
|
|
|
|
to be notified when new versions of ``bidict`` are released.
|
2019-09-08 00:04:06 +00:00
|
|
|
|
|
2018-04-06 04:28:44 +00:00
|
|
|
|
|
2020-12-20 15:40:40 +00:00
|
|
|
|
0.21.3 (not yet released)
|
|
|
|
|
-------------------------
|
|
|
|
|
|
|
|
|
|
- Remove ``bidict.__version_info__`` attribute.
|
|
|
|
|
|
|
|
|
|
|
2020-09-07 16:06:00 +00:00
|
|
|
|
0.21.2 (2020-09-07)
|
2020-09-07 14:41:36 +00:00
|
|
|
|
-------------------
|
|
|
|
|
|
|
|
|
|
- Include `py.typed <https://www.python.org/dev/peps/pep-0561/#packaging-type-information>`__
|
|
|
|
|
file to mark :mod:`bidict` as type hinted.
|
|
|
|
|
|
|
|
|
|
|
2020-09-07 16:06:00 +00:00
|
|
|
|
0.21.1 (2020-09-07)
|
|
|
|
|
-------------------
|
|
|
|
|
|
|
|
|
|
This release was yanked and replaced with the 0.21.2 release,
|
|
|
|
|
which actually provides the intended changes.
|
|
|
|
|
|
|
|
|
|
|
2020-08-22 14:32:51 +00:00
|
|
|
|
0.21.0 (2020-08-22)
|
|
|
|
|
-------------------
|
2020-08-01 18:26:08 +00:00
|
|
|
|
|
|
|
|
|
- :mod:`bidict` now provides
|
|
|
|
|
`type hints <https://www.python.org/dev/peps/pep-0484/>`__! ⌨️ ✅
|
|
|
|
|
|
|
|
|
|
Adding type hints to :mod:`bidict` poses particularly interesting challenges
|
|
|
|
|
due to the combination of generic types,
|
|
|
|
|
dynamically-generated types
|
|
|
|
|
(such as :ref:`inverse bidict classes <extending:Dynamic Inverse Class Generation>`
|
|
|
|
|
and :func:`namedbidicts <bidict.namedbidict>`),
|
|
|
|
|
and complicating optimizations
|
|
|
|
|
such as the use of slots and weakrefs.
|
|
|
|
|
|
|
|
|
|
It didn't take long to hit bugs and missing features
|
|
|
|
|
in the state of the art for type hinting in Python today,
|
2020-08-22 14:32:51 +00:00
|
|
|
|
e.g. missing higher-kinded types support
|
2020-08-01 18:26:08 +00:00
|
|
|
|
(`python/typing#548 <https://github.com/python/typing/issues/548#issuecomment-621195693>`__),
|
|
|
|
|
too-narrow type hints for :class:`collections.abc.Mapping`
|
|
|
|
|
(`python/typeshed#4435 <https://github.com/python/typeshed/issues/4435>`__),
|
|
|
|
|
a :class:`typing.Generic` bug in Python 3.6
|
|
|
|
|
(`BPO-41451 <https://bugs.python.org/issue41451>`__), etc.
|
|
|
|
|
|
|
|
|
|
That said, this release should provide a solid foundation
|
|
|
|
|
for code using :mod:`bidict` that enables static type checking.
|
|
|
|
|
|
|
|
|
|
As always, if you spot any opportunities to improve :mod:`bidict`
|
|
|
|
|
(including its new type hints),
|
|
|
|
|
please don't hesitate to submit a PR!
|
|
|
|
|
|
|
|
|
|
- Add :class:`bidict.MutableBidirectionalMapping` ABC.
|
|
|
|
|
|
|
|
|
|
The :ref:`other-bidict-types:Bidict Types Diagram` has been updated accordingly.
|
|
|
|
|
|
|
|
|
|
- Drop support for Python 3.5,
|
|
|
|
|
which reaches end of life on 2020-09-13,
|
|
|
|
|
represents a tiny percentage of bidict downloads on
|
|
|
|
|
`PyPI Stats <https://pypistats.org/packages/bidict>`__,
|
|
|
|
|
and lacks support for
|
|
|
|
|
`variable type hint syntax <https://www.python.org/dev/peps/pep-0526/>`__,
|
|
|
|
|
`ordered dicts <https://stackoverflow.com/a/39980744>`__,
|
|
|
|
|
and :attr:`object.__init_subclass__`.
|
|
|
|
|
|
|
|
|
|
- Remove the no-longer-needed ``bidict.compat`` module.
|
|
|
|
|
|
|
|
|
|
- Move :ref:`inverse bidict class access <extending:Dynamic Inverse Class Generation>`
|
|
|
|
|
from a property to an attribute set in
|
|
|
|
|
:attr:`~bidict.BidictBase.__init_subclass__`,
|
|
|
|
|
to save function call overhead on repeated access.
|
|
|
|
|
|
|
|
|
|
- :meth:`bidict.OrderedBidictBase.__iter__` no longer accepts
|
|
|
|
|
a ``reverse`` keyword argument so that it matches the signature of
|
|
|
|
|
:meth:`container.__iter__`.
|
|
|
|
|
|
|
|
|
|
- Set the ``__module__`` attribute of various :mod:`bidict` types
|
|
|
|
|
(using :func:`sys._getframe` when necessary)
|
|
|
|
|
so that private, internal modules are not exposed
|
|
|
|
|
e.g. in classes' repr strings.
|
|
|
|
|
|
|
|
|
|
- :func:`~bidict.namedbidict` now immediately raises :class:`TypeError`
|
|
|
|
|
if the provided ``base_type`` does not provide
|
|
|
|
|
``_isinv`` or :meth:`~object.__getstate__`,
|
|
|
|
|
rather than succeeding with a class whose instances may raise
|
|
|
|
|
:class:`AttributeError` when these attributes are accessed.
|
2020-07-26 17:21:27 +00:00
|
|
|
|
|
|
|
|
|
|
2020-07-23 13:42:41 +00:00
|
|
|
|
0.20.0 (2020-07-23)
|
|
|
|
|
-------------------
|
2020-01-09 02:48:49 +00:00
|
|
|
|
|
2020-07-01 13:27:28 +00:00
|
|
|
|
The following breaking changes are expected to affect few if any users.
|
|
|
|
|
|
2020-01-09 02:48:49 +00:00
|
|
|
|
Remove APIs deprecated in the previous release:
|
|
|
|
|
|
|
|
|
|
- ``bidict.OVERWRITE`` and ``bidict.IGNORE``.
|
|
|
|
|
|
2020-07-01 13:27:28 +00:00
|
|
|
|
- The ``on_dup_key``, ``on_dup_val``, and ``on_dup_kv`` arguments of
|
|
|
|
|
:meth:`~bidict.bidict.put` and :meth:`~bidict.bidict.putall`.
|
2020-01-09 02:48:49 +00:00
|
|
|
|
|
|
|
|
|
- The ``on_dup_key``, ``on_dup_val``, and ``on_dup_kv``
|
|
|
|
|
:class:`~bidict.bidict` class attributes.
|
|
|
|
|
|
2020-07-22 01:51:14 +00:00
|
|
|
|
- Remove :meth:`bidict.BidirectionalMapping.__subclasshook__`
|
|
|
|
|
due to lack of use and maintenance cost.
|
|
|
|
|
|
|
|
|
|
Fixes a bug introduced in 0.15.0
|
|
|
|
|
that caused any class with an ``inverse`` attribute
|
|
|
|
|
to be incorrectly considered a subclass of :class:`collections.abc.Mapping`.
|
|
|
|
|
`#111 <https://github.com/jab/bidict/issues/111>`__
|
|
|
|
|
|
2020-01-09 02:48:49 +00:00
|
|
|
|
|
2020-01-09 02:09:36 +00:00
|
|
|
|
0.19.0 (2020-01-09)
|
|
|
|
|
-------------------
|
2019-11-04 02:54:52 +00:00
|
|
|
|
|
2020-01-09 02:48:49 +00:00
|
|
|
|
- Drop support for Python 2
|
2019-11-13 02:53:39 +00:00
|
|
|
|
:ref:`as promised in v0.18.2 <changelog:0.18.2 (2019-09-08)>`.
|
|
|
|
|
|
2020-07-30 13:31:03 +00:00
|
|
|
|
The ``bidict.compat`` module has been pruned accordingly.
|
2019-11-13 02:53:39 +00:00
|
|
|
|
|
|
|
|
|
This makes bidict more efficient on Python 3
|
|
|
|
|
and enables further improvement to bidict in the future.
|
|
|
|
|
|
2020-01-09 02:48:49 +00:00
|
|
|
|
- Deprecate ``bidict.OVERWRITE`` and ``bidict.IGNORE``.
|
Various API changes and other improvements.
* Deprecate ``bidict.OVERWRITE`` and ``bidict.IGNORE``.
A :class:`UserWarning` will now be emitted if these are used.
:attr:`bidict.DROP_OLD` and :attr:`bidict.DROP_NEW` should be used instead.
* Rename ``DuplicationPolicy`` to :class:`~bidict.OnDupAction`
(and implement it via an :class:`~enum.Enum`).
A :class:`~bidict.OnDupAction` may be one of
:attr:`~bidict.RAISE`,
:attr:`~bidict.DROP_OLD`, or
:attr:`~bidict.DROP_NEW`.
* Expose the new :class:`~bidict.OnDup` class,
a named (*key*, *val*, *kv*) tuple of :class:`~bidict.OnDupAction`\s
that should be taken upon encountering
the 3 kinds of duplication that can occur.
* Provide the
:attr:`~bidict.ON_DUP_DEFAULT`,
:attr:`~bidict.ON_DUP_RAISE`, and
:attr:`~bidict.ON_DUP_DROP_OLD`
:class:`~bidict.OnDup` convenience instances.
* Deprecate the
``on_dup_key``, ``on_dup_val``, and ``on_dup_kv`` arguments
of :meth:`~bidict.bidict.put` and :meth:`~bidict.bidict.putall`.
A :class:`UserWarning` will now be emitted if these are used.
They have been subsumed by the new *on_dup* argument,
which takes an :class:`~bidict.OnDup` instance.
Use it like this: ``bi.put(1, 2, OnDup(key=DROP_NEW))``.
Or better yet, pass one of the
``ON_DUP_*`` convenience instances
instead if possible.
See the updated :ref:`basic-usage:Values Must Be Unique` docs for more info.
* Deprecate the
``on_dup_key``, ``on_dup_val``, and ``on_dup_kv``
bidict class attributes.
A :class:`UserWarning` will now be emitted if these are used.
They have been subsumed by the new
:attr:`~bidict.bidict.on_dup` class attribute,
which takes an :class:`~bidict.OnDup` instance.
See the updated :doc:`extending` docs for example usage.
* Move
:meth:`bidict.BidictBase.values` to
:meth:`bidict.BidirectionalMapping.values`,
since the implementation is generic.
* No longer use ``__all__`` in ``bidict/__init__.py``.
* Cap max_size rather than disabling health checks and deadline as a
less heavyhanded way to improve hypothesis test reliability on Travis.
2020-01-07 22:20:20 +00:00
|
|
|
|
A :class:`UserWarning` will now be emitted if these are used.
|
|
|
|
|
|
|
|
|
|
:attr:`bidict.DROP_OLD` and :attr:`bidict.DROP_NEW` should be used instead.
|
|
|
|
|
|
2020-01-09 02:48:49 +00:00
|
|
|
|
- Rename ``DuplicationPolicy`` to :class:`~bidict.OnDupAction`
|
Various API changes and other improvements.
* Deprecate ``bidict.OVERWRITE`` and ``bidict.IGNORE``.
A :class:`UserWarning` will now be emitted if these are used.
:attr:`bidict.DROP_OLD` and :attr:`bidict.DROP_NEW` should be used instead.
* Rename ``DuplicationPolicy`` to :class:`~bidict.OnDupAction`
(and implement it via an :class:`~enum.Enum`).
A :class:`~bidict.OnDupAction` may be one of
:attr:`~bidict.RAISE`,
:attr:`~bidict.DROP_OLD`, or
:attr:`~bidict.DROP_NEW`.
* Expose the new :class:`~bidict.OnDup` class,
a named (*key*, *val*, *kv*) tuple of :class:`~bidict.OnDupAction`\s
that should be taken upon encountering
the 3 kinds of duplication that can occur.
* Provide the
:attr:`~bidict.ON_DUP_DEFAULT`,
:attr:`~bidict.ON_DUP_RAISE`, and
:attr:`~bidict.ON_DUP_DROP_OLD`
:class:`~bidict.OnDup` convenience instances.
* Deprecate the
``on_dup_key``, ``on_dup_val``, and ``on_dup_kv`` arguments
of :meth:`~bidict.bidict.put` and :meth:`~bidict.bidict.putall`.
A :class:`UserWarning` will now be emitted if these are used.
They have been subsumed by the new *on_dup* argument,
which takes an :class:`~bidict.OnDup` instance.
Use it like this: ``bi.put(1, 2, OnDup(key=DROP_NEW))``.
Or better yet, pass one of the
``ON_DUP_*`` convenience instances
instead if possible.
See the updated :ref:`basic-usage:Values Must Be Unique` docs for more info.
* Deprecate the
``on_dup_key``, ``on_dup_val``, and ``on_dup_kv``
bidict class attributes.
A :class:`UserWarning` will now be emitted if these are used.
They have been subsumed by the new
:attr:`~bidict.bidict.on_dup` class attribute,
which takes an :class:`~bidict.OnDup` instance.
See the updated :doc:`extending` docs for example usage.
* Move
:meth:`bidict.BidictBase.values` to
:meth:`bidict.BidirectionalMapping.values`,
since the implementation is generic.
* No longer use ``__all__`` in ``bidict/__init__.py``.
* Cap max_size rather than disabling health checks and deadline as a
less heavyhanded way to improve hypothesis test reliability on Travis.
2020-01-07 22:20:20 +00:00
|
|
|
|
(and implement it via an :class:`~enum.Enum`).
|
|
|
|
|
|
|
|
|
|
An :class:`~bidict.OnDupAction` may be one of
|
|
|
|
|
:attr:`~bidict.RAISE`,
|
|
|
|
|
:attr:`~bidict.DROP_OLD`, or
|
|
|
|
|
:attr:`~bidict.DROP_NEW`.
|
|
|
|
|
|
2020-07-01 13:27:28 +00:00
|
|
|
|
- Expose the new :class:`~bidict.OnDup` class
|
|
|
|
|
to contain the three :class:`~bidict.OnDupAction`\s
|
Various API changes and other improvements.
* Deprecate ``bidict.OVERWRITE`` and ``bidict.IGNORE``.
A :class:`UserWarning` will now be emitted if these are used.
:attr:`bidict.DROP_OLD` and :attr:`bidict.DROP_NEW` should be used instead.
* Rename ``DuplicationPolicy`` to :class:`~bidict.OnDupAction`
(and implement it via an :class:`~enum.Enum`).
A :class:`~bidict.OnDupAction` may be one of
:attr:`~bidict.RAISE`,
:attr:`~bidict.DROP_OLD`, or
:attr:`~bidict.DROP_NEW`.
* Expose the new :class:`~bidict.OnDup` class,
a named (*key*, *val*, *kv*) tuple of :class:`~bidict.OnDupAction`\s
that should be taken upon encountering
the 3 kinds of duplication that can occur.
* Provide the
:attr:`~bidict.ON_DUP_DEFAULT`,
:attr:`~bidict.ON_DUP_RAISE`, and
:attr:`~bidict.ON_DUP_DROP_OLD`
:class:`~bidict.OnDup` convenience instances.
* Deprecate the
``on_dup_key``, ``on_dup_val``, and ``on_dup_kv`` arguments
of :meth:`~bidict.bidict.put` and :meth:`~bidict.bidict.putall`.
A :class:`UserWarning` will now be emitted if these are used.
They have been subsumed by the new *on_dup* argument,
which takes an :class:`~bidict.OnDup` instance.
Use it like this: ``bi.put(1, 2, OnDup(key=DROP_NEW))``.
Or better yet, pass one of the
``ON_DUP_*`` convenience instances
instead if possible.
See the updated :ref:`basic-usage:Values Must Be Unique` docs for more info.
* Deprecate the
``on_dup_key``, ``on_dup_val``, and ``on_dup_kv``
bidict class attributes.
A :class:`UserWarning` will now be emitted if these are used.
They have been subsumed by the new
:attr:`~bidict.bidict.on_dup` class attribute,
which takes an :class:`~bidict.OnDup` instance.
See the updated :doc:`extending` docs for example usage.
* Move
:meth:`bidict.BidictBase.values` to
:meth:`bidict.BidirectionalMapping.values`,
since the implementation is generic.
* No longer use ``__all__`` in ``bidict/__init__.py``.
* Cap max_size rather than disabling health checks and deadline as a
less heavyhanded way to improve hypothesis test reliability on Travis.
2020-01-07 22:20:20 +00:00
|
|
|
|
that should be taken upon encountering
|
2020-07-01 13:27:28 +00:00
|
|
|
|
the three kinds of duplication that can occur
|
Various API changes and other improvements.
* Deprecate ``bidict.OVERWRITE`` and ``bidict.IGNORE``.
A :class:`UserWarning` will now be emitted if these are used.
:attr:`bidict.DROP_OLD` and :attr:`bidict.DROP_NEW` should be used instead.
* Rename ``DuplicationPolicy`` to :class:`~bidict.OnDupAction`
(and implement it via an :class:`~enum.Enum`).
A :class:`~bidict.OnDupAction` may be one of
:attr:`~bidict.RAISE`,
:attr:`~bidict.DROP_OLD`, or
:attr:`~bidict.DROP_NEW`.
* Expose the new :class:`~bidict.OnDup` class,
a named (*key*, *val*, *kv*) tuple of :class:`~bidict.OnDupAction`\s
that should be taken upon encountering
the 3 kinds of duplication that can occur.
* Provide the
:attr:`~bidict.ON_DUP_DEFAULT`,
:attr:`~bidict.ON_DUP_RAISE`, and
:attr:`~bidict.ON_DUP_DROP_OLD`
:class:`~bidict.OnDup` convenience instances.
* Deprecate the
``on_dup_key``, ``on_dup_val``, and ``on_dup_kv`` arguments
of :meth:`~bidict.bidict.put` and :meth:`~bidict.bidict.putall`.
A :class:`UserWarning` will now be emitted if these are used.
They have been subsumed by the new *on_dup* argument,
which takes an :class:`~bidict.OnDup` instance.
Use it like this: ``bi.put(1, 2, OnDup(key=DROP_NEW))``.
Or better yet, pass one of the
``ON_DUP_*`` convenience instances
instead if possible.
See the updated :ref:`basic-usage:Values Must Be Unique` docs for more info.
* Deprecate the
``on_dup_key``, ``on_dup_val``, and ``on_dup_kv``
bidict class attributes.
A :class:`UserWarning` will now be emitted if these are used.
They have been subsumed by the new
:attr:`~bidict.bidict.on_dup` class attribute,
which takes an :class:`~bidict.OnDup` instance.
See the updated :doc:`extending` docs for example usage.
* Move
:meth:`bidict.BidictBase.values` to
:meth:`bidict.BidirectionalMapping.values`,
since the implementation is generic.
* No longer use ``__all__`` in ``bidict/__init__.py``.
* Cap max_size rather than disabling health checks and deadline as a
less heavyhanded way to improve hypothesis test reliability on Travis.
2020-01-07 22:20:20 +00:00
|
|
|
|
(*key*, *val*, *kv*).
|
|
|
|
|
|
2020-01-09 02:48:49 +00:00
|
|
|
|
- Provide the
|
Various API changes and other improvements.
* Deprecate ``bidict.OVERWRITE`` and ``bidict.IGNORE``.
A :class:`UserWarning` will now be emitted if these are used.
:attr:`bidict.DROP_OLD` and :attr:`bidict.DROP_NEW` should be used instead.
* Rename ``DuplicationPolicy`` to :class:`~bidict.OnDupAction`
(and implement it via an :class:`~enum.Enum`).
A :class:`~bidict.OnDupAction` may be one of
:attr:`~bidict.RAISE`,
:attr:`~bidict.DROP_OLD`, or
:attr:`~bidict.DROP_NEW`.
* Expose the new :class:`~bidict.OnDup` class,
a named (*key*, *val*, *kv*) tuple of :class:`~bidict.OnDupAction`\s
that should be taken upon encountering
the 3 kinds of duplication that can occur.
* Provide the
:attr:`~bidict.ON_DUP_DEFAULT`,
:attr:`~bidict.ON_DUP_RAISE`, and
:attr:`~bidict.ON_DUP_DROP_OLD`
:class:`~bidict.OnDup` convenience instances.
* Deprecate the
``on_dup_key``, ``on_dup_val``, and ``on_dup_kv`` arguments
of :meth:`~bidict.bidict.put` and :meth:`~bidict.bidict.putall`.
A :class:`UserWarning` will now be emitted if these are used.
They have been subsumed by the new *on_dup* argument,
which takes an :class:`~bidict.OnDup` instance.
Use it like this: ``bi.put(1, 2, OnDup(key=DROP_NEW))``.
Or better yet, pass one of the
``ON_DUP_*`` convenience instances
instead if possible.
See the updated :ref:`basic-usage:Values Must Be Unique` docs for more info.
* Deprecate the
``on_dup_key``, ``on_dup_val``, and ``on_dup_kv``
bidict class attributes.
A :class:`UserWarning` will now be emitted if these are used.
They have been subsumed by the new
:attr:`~bidict.bidict.on_dup` class attribute,
which takes an :class:`~bidict.OnDup` instance.
See the updated :doc:`extending` docs for example usage.
* Move
:meth:`bidict.BidictBase.values` to
:meth:`bidict.BidirectionalMapping.values`,
since the implementation is generic.
* No longer use ``__all__`` in ``bidict/__init__.py``.
* Cap max_size rather than disabling health checks and deadline as a
less heavyhanded way to improve hypothesis test reliability on Travis.
2020-01-07 22:20:20 +00:00
|
|
|
|
:attr:`~bidict.ON_DUP_DEFAULT`,
|
|
|
|
|
:attr:`~bidict.ON_DUP_RAISE`, and
|
|
|
|
|
:attr:`~bidict.ON_DUP_DROP_OLD`
|
|
|
|
|
:class:`~bidict.OnDup` convenience instances.
|
|
|
|
|
|
2020-01-09 02:48:49 +00:00
|
|
|
|
- Deprecate the
|
Various API changes and other improvements.
* Deprecate ``bidict.OVERWRITE`` and ``bidict.IGNORE``.
A :class:`UserWarning` will now be emitted if these are used.
:attr:`bidict.DROP_OLD` and :attr:`bidict.DROP_NEW` should be used instead.
* Rename ``DuplicationPolicy`` to :class:`~bidict.OnDupAction`
(and implement it via an :class:`~enum.Enum`).
A :class:`~bidict.OnDupAction` may be one of
:attr:`~bidict.RAISE`,
:attr:`~bidict.DROP_OLD`, or
:attr:`~bidict.DROP_NEW`.
* Expose the new :class:`~bidict.OnDup` class,
a named (*key*, *val*, *kv*) tuple of :class:`~bidict.OnDupAction`\s
that should be taken upon encountering
the 3 kinds of duplication that can occur.
* Provide the
:attr:`~bidict.ON_DUP_DEFAULT`,
:attr:`~bidict.ON_DUP_RAISE`, and
:attr:`~bidict.ON_DUP_DROP_OLD`
:class:`~bidict.OnDup` convenience instances.
* Deprecate the
``on_dup_key``, ``on_dup_val``, and ``on_dup_kv`` arguments
of :meth:`~bidict.bidict.put` and :meth:`~bidict.bidict.putall`.
A :class:`UserWarning` will now be emitted if these are used.
They have been subsumed by the new *on_dup* argument,
which takes an :class:`~bidict.OnDup` instance.
Use it like this: ``bi.put(1, 2, OnDup(key=DROP_NEW))``.
Or better yet, pass one of the
``ON_DUP_*`` convenience instances
instead if possible.
See the updated :ref:`basic-usage:Values Must Be Unique` docs for more info.
* Deprecate the
``on_dup_key``, ``on_dup_val``, and ``on_dup_kv``
bidict class attributes.
A :class:`UserWarning` will now be emitted if these are used.
They have been subsumed by the new
:attr:`~bidict.bidict.on_dup` class attribute,
which takes an :class:`~bidict.OnDup` instance.
See the updated :doc:`extending` docs for example usage.
* Move
:meth:`bidict.BidictBase.values` to
:meth:`bidict.BidirectionalMapping.values`,
since the implementation is generic.
* No longer use ``__all__`` in ``bidict/__init__.py``.
* Cap max_size rather than disabling health checks and deadline as a
less heavyhanded way to improve hypothesis test reliability on Travis.
2020-01-07 22:20:20 +00:00
|
|
|
|
``on_dup_key``, ``on_dup_val``, and ``on_dup_kv`` arguments
|
|
|
|
|
of :meth:`~bidict.bidict.put` and :meth:`~bidict.bidict.putall`.
|
|
|
|
|
A :class:`UserWarning` will now be emitted if these are used.
|
|
|
|
|
|
|
|
|
|
These have been subsumed by the new *on_dup* argument,
|
|
|
|
|
which takes an :class:`~bidict.OnDup` instance.
|
|
|
|
|
|
2020-07-01 13:27:28 +00:00
|
|
|
|
Use it like this: ``bi.put(1, 2, OnDup(key=RAISE, val=...))``.
|
|
|
|
|
Or pass one of the instances already provided,
|
|
|
|
|
such as :attr:`~bidict.ON_DUP_DROP_OLD`.
|
|
|
|
|
Or just don't pass an *on_dup* argument
|
|
|
|
|
to use the default value of :attr:`~bidict.ON_DUP_RAISE`.
|
Various API changes and other improvements.
* Deprecate ``bidict.OVERWRITE`` and ``bidict.IGNORE``.
A :class:`UserWarning` will now be emitted if these are used.
:attr:`bidict.DROP_OLD` and :attr:`bidict.DROP_NEW` should be used instead.
* Rename ``DuplicationPolicy`` to :class:`~bidict.OnDupAction`
(and implement it via an :class:`~enum.Enum`).
A :class:`~bidict.OnDupAction` may be one of
:attr:`~bidict.RAISE`,
:attr:`~bidict.DROP_OLD`, or
:attr:`~bidict.DROP_NEW`.
* Expose the new :class:`~bidict.OnDup` class,
a named (*key*, *val*, *kv*) tuple of :class:`~bidict.OnDupAction`\s
that should be taken upon encountering
the 3 kinds of duplication that can occur.
* Provide the
:attr:`~bidict.ON_DUP_DEFAULT`,
:attr:`~bidict.ON_DUP_RAISE`, and
:attr:`~bidict.ON_DUP_DROP_OLD`
:class:`~bidict.OnDup` convenience instances.
* Deprecate the
``on_dup_key``, ``on_dup_val``, and ``on_dup_kv`` arguments
of :meth:`~bidict.bidict.put` and :meth:`~bidict.bidict.putall`.
A :class:`UserWarning` will now be emitted if these are used.
They have been subsumed by the new *on_dup* argument,
which takes an :class:`~bidict.OnDup` instance.
Use it like this: ``bi.put(1, 2, OnDup(key=DROP_NEW))``.
Or better yet, pass one of the
``ON_DUP_*`` convenience instances
instead if possible.
See the updated :ref:`basic-usage:Values Must Be Unique` docs for more info.
* Deprecate the
``on_dup_key``, ``on_dup_val``, and ``on_dup_kv``
bidict class attributes.
A :class:`UserWarning` will now be emitted if these are used.
They have been subsumed by the new
:attr:`~bidict.bidict.on_dup` class attribute,
which takes an :class:`~bidict.OnDup` instance.
See the updated :doc:`extending` docs for example usage.
* Move
:meth:`bidict.BidictBase.values` to
:meth:`bidict.BidirectionalMapping.values`,
since the implementation is generic.
* No longer use ``__all__`` in ``bidict/__init__.py``.
* Cap max_size rather than disabling health checks and deadline as a
less heavyhanded way to improve hypothesis test reliability on Travis.
2020-01-07 22:20:20 +00:00
|
|
|
|
|
2020-07-01 13:27:28 +00:00
|
|
|
|
The :ref:`basic-usage:Values Must Be Unique` docs
|
|
|
|
|
have been updated accordingly.
|
Various API changes and other improvements.
* Deprecate ``bidict.OVERWRITE`` and ``bidict.IGNORE``.
A :class:`UserWarning` will now be emitted if these are used.
:attr:`bidict.DROP_OLD` and :attr:`bidict.DROP_NEW` should be used instead.
* Rename ``DuplicationPolicy`` to :class:`~bidict.OnDupAction`
(and implement it via an :class:`~enum.Enum`).
A :class:`~bidict.OnDupAction` may be one of
:attr:`~bidict.RAISE`,
:attr:`~bidict.DROP_OLD`, or
:attr:`~bidict.DROP_NEW`.
* Expose the new :class:`~bidict.OnDup` class,
a named (*key*, *val*, *kv*) tuple of :class:`~bidict.OnDupAction`\s
that should be taken upon encountering
the 3 kinds of duplication that can occur.
* Provide the
:attr:`~bidict.ON_DUP_DEFAULT`,
:attr:`~bidict.ON_DUP_RAISE`, and
:attr:`~bidict.ON_DUP_DROP_OLD`
:class:`~bidict.OnDup` convenience instances.
* Deprecate the
``on_dup_key``, ``on_dup_val``, and ``on_dup_kv`` arguments
of :meth:`~bidict.bidict.put` and :meth:`~bidict.bidict.putall`.
A :class:`UserWarning` will now be emitted if these are used.
They have been subsumed by the new *on_dup* argument,
which takes an :class:`~bidict.OnDup` instance.
Use it like this: ``bi.put(1, 2, OnDup(key=DROP_NEW))``.
Or better yet, pass one of the
``ON_DUP_*`` convenience instances
instead if possible.
See the updated :ref:`basic-usage:Values Must Be Unique` docs for more info.
* Deprecate the
``on_dup_key``, ``on_dup_val``, and ``on_dup_kv``
bidict class attributes.
A :class:`UserWarning` will now be emitted if these are used.
They have been subsumed by the new
:attr:`~bidict.bidict.on_dup` class attribute,
which takes an :class:`~bidict.OnDup` instance.
See the updated :doc:`extending` docs for example usage.
* Move
:meth:`bidict.BidictBase.values` to
:meth:`bidict.BidirectionalMapping.values`,
since the implementation is generic.
* No longer use ``__all__`` in ``bidict/__init__.py``.
* Cap max_size rather than disabling health checks and deadline as a
less heavyhanded way to improve hypothesis test reliability on Travis.
2020-01-07 22:20:20 +00:00
|
|
|
|
|
2020-01-09 02:48:49 +00:00
|
|
|
|
- Deprecate the
|
Various API changes and other improvements.
* Deprecate ``bidict.OVERWRITE`` and ``bidict.IGNORE``.
A :class:`UserWarning` will now be emitted if these are used.
:attr:`bidict.DROP_OLD` and :attr:`bidict.DROP_NEW` should be used instead.
* Rename ``DuplicationPolicy`` to :class:`~bidict.OnDupAction`
(and implement it via an :class:`~enum.Enum`).
A :class:`~bidict.OnDupAction` may be one of
:attr:`~bidict.RAISE`,
:attr:`~bidict.DROP_OLD`, or
:attr:`~bidict.DROP_NEW`.
* Expose the new :class:`~bidict.OnDup` class,
a named (*key*, *val*, *kv*) tuple of :class:`~bidict.OnDupAction`\s
that should be taken upon encountering
the 3 kinds of duplication that can occur.
* Provide the
:attr:`~bidict.ON_DUP_DEFAULT`,
:attr:`~bidict.ON_DUP_RAISE`, and
:attr:`~bidict.ON_DUP_DROP_OLD`
:class:`~bidict.OnDup` convenience instances.
* Deprecate the
``on_dup_key``, ``on_dup_val``, and ``on_dup_kv`` arguments
of :meth:`~bidict.bidict.put` and :meth:`~bidict.bidict.putall`.
A :class:`UserWarning` will now be emitted if these are used.
They have been subsumed by the new *on_dup* argument,
which takes an :class:`~bidict.OnDup` instance.
Use it like this: ``bi.put(1, 2, OnDup(key=DROP_NEW))``.
Or better yet, pass one of the
``ON_DUP_*`` convenience instances
instead if possible.
See the updated :ref:`basic-usage:Values Must Be Unique` docs for more info.
* Deprecate the
``on_dup_key``, ``on_dup_val``, and ``on_dup_kv``
bidict class attributes.
A :class:`UserWarning` will now be emitted if these are used.
They have been subsumed by the new
:attr:`~bidict.bidict.on_dup` class attribute,
which takes an :class:`~bidict.OnDup` instance.
See the updated :doc:`extending` docs for example usage.
* Move
:meth:`bidict.BidictBase.values` to
:meth:`bidict.BidirectionalMapping.values`,
since the implementation is generic.
* No longer use ``__all__`` in ``bidict/__init__.py``.
* Cap max_size rather than disabling health checks and deadline as a
less heavyhanded way to improve hypothesis test reliability on Travis.
2020-01-07 22:20:20 +00:00
|
|
|
|
``on_dup_key``, ``on_dup_val``, and ``on_dup_kv``
|
2020-01-09 02:48:49 +00:00
|
|
|
|
:class:`~bidict.bidict` class attributes.
|
Various API changes and other improvements.
* Deprecate ``bidict.OVERWRITE`` and ``bidict.IGNORE``.
A :class:`UserWarning` will now be emitted if these are used.
:attr:`bidict.DROP_OLD` and :attr:`bidict.DROP_NEW` should be used instead.
* Rename ``DuplicationPolicy`` to :class:`~bidict.OnDupAction`
(and implement it via an :class:`~enum.Enum`).
A :class:`~bidict.OnDupAction` may be one of
:attr:`~bidict.RAISE`,
:attr:`~bidict.DROP_OLD`, or
:attr:`~bidict.DROP_NEW`.
* Expose the new :class:`~bidict.OnDup` class,
a named (*key*, *val*, *kv*) tuple of :class:`~bidict.OnDupAction`\s
that should be taken upon encountering
the 3 kinds of duplication that can occur.
* Provide the
:attr:`~bidict.ON_DUP_DEFAULT`,
:attr:`~bidict.ON_DUP_RAISE`, and
:attr:`~bidict.ON_DUP_DROP_OLD`
:class:`~bidict.OnDup` convenience instances.
* Deprecate the
``on_dup_key``, ``on_dup_val``, and ``on_dup_kv`` arguments
of :meth:`~bidict.bidict.put` and :meth:`~bidict.bidict.putall`.
A :class:`UserWarning` will now be emitted if these are used.
They have been subsumed by the new *on_dup* argument,
which takes an :class:`~bidict.OnDup` instance.
Use it like this: ``bi.put(1, 2, OnDup(key=DROP_NEW))``.
Or better yet, pass one of the
``ON_DUP_*`` convenience instances
instead if possible.
See the updated :ref:`basic-usage:Values Must Be Unique` docs for more info.
* Deprecate the
``on_dup_key``, ``on_dup_val``, and ``on_dup_kv``
bidict class attributes.
A :class:`UserWarning` will now be emitted if these are used.
They have been subsumed by the new
:attr:`~bidict.bidict.on_dup` class attribute,
which takes an :class:`~bidict.OnDup` instance.
See the updated :doc:`extending` docs for example usage.
* Move
:meth:`bidict.BidictBase.values` to
:meth:`bidict.BidirectionalMapping.values`,
since the implementation is generic.
* No longer use ``__all__`` in ``bidict/__init__.py``.
* Cap max_size rather than disabling health checks and deadline as a
less heavyhanded way to improve hypothesis test reliability on Travis.
2020-01-07 22:20:20 +00:00
|
|
|
|
A :class:`UserWarning` will now be emitted if these are used.
|
|
|
|
|
|
|
|
|
|
These have been subsumed by the new
|
|
|
|
|
:attr:`~bidict.bidict.on_dup` class attribute,
|
|
|
|
|
which takes an :class:`~bidict.OnDup` instance.
|
|
|
|
|
|
|
|
|
|
See the updated :doc:`extending` docs for example usage.
|
2019-11-13 02:53:39 +00:00
|
|
|
|
|
2020-01-09 02:48:49 +00:00
|
|
|
|
- Improve the more efficient implementations of
|
2019-11-13 02:53:39 +00:00
|
|
|
|
:meth:`~bidict.BidirectionalMapping.keys`,
|
|
|
|
|
:meth:`~bidict.BidirectionalMapping.values`, and
|
|
|
|
|
:meth:`~bidict.BidirectionalMapping.items`,
|
|
|
|
|
and now also provide a more efficient implementation of
|
|
|
|
|
:meth:`~bidict.BidirectionalMapping.__iter__`
|
Various API changes and other improvements.
* Deprecate ``bidict.OVERWRITE`` and ``bidict.IGNORE``.
A :class:`UserWarning` will now be emitted if these are used.
:attr:`bidict.DROP_OLD` and :attr:`bidict.DROP_NEW` should be used instead.
* Rename ``DuplicationPolicy`` to :class:`~bidict.OnDupAction`
(and implement it via an :class:`~enum.Enum`).
A :class:`~bidict.OnDupAction` may be one of
:attr:`~bidict.RAISE`,
:attr:`~bidict.DROP_OLD`, or
:attr:`~bidict.DROP_NEW`.
* Expose the new :class:`~bidict.OnDup` class,
a named (*key*, *val*, *kv*) tuple of :class:`~bidict.OnDupAction`\s
that should be taken upon encountering
the 3 kinds of duplication that can occur.
* Provide the
:attr:`~bidict.ON_DUP_DEFAULT`,
:attr:`~bidict.ON_DUP_RAISE`, and
:attr:`~bidict.ON_DUP_DROP_OLD`
:class:`~bidict.OnDup` convenience instances.
* Deprecate the
``on_dup_key``, ``on_dup_val``, and ``on_dup_kv`` arguments
of :meth:`~bidict.bidict.put` and :meth:`~bidict.bidict.putall`.
A :class:`UserWarning` will now be emitted if these are used.
They have been subsumed by the new *on_dup* argument,
which takes an :class:`~bidict.OnDup` instance.
Use it like this: ``bi.put(1, 2, OnDup(key=DROP_NEW))``.
Or better yet, pass one of the
``ON_DUP_*`` convenience instances
instead if possible.
See the updated :ref:`basic-usage:Values Must Be Unique` docs for more info.
* Deprecate the
``on_dup_key``, ``on_dup_val``, and ``on_dup_kv``
bidict class attributes.
A :class:`UserWarning` will now be emitted if these are used.
They have been subsumed by the new
:attr:`~bidict.bidict.on_dup` class attribute,
which takes an :class:`~bidict.OnDup` instance.
See the updated :doc:`extending` docs for example usage.
* Move
:meth:`bidict.BidictBase.values` to
:meth:`bidict.BidirectionalMapping.values`,
since the implementation is generic.
* No longer use ``__all__`` in ``bidict/__init__.py``.
* Cap max_size rather than disabling health checks and deadline as a
less heavyhanded way to improve hypothesis test reliability on Travis.
2020-01-07 22:20:20 +00:00
|
|
|
|
by delegating to backing :class:`dict`\s
|
2019-11-13 02:53:39 +00:00
|
|
|
|
in the bidict types for which this is possible.
|
2019-11-04 02:54:52 +00:00
|
|
|
|
|
2020-01-09 02:48:49 +00:00
|
|
|
|
- Move
|
Various API changes and other improvements.
* Deprecate ``bidict.OVERWRITE`` and ``bidict.IGNORE``.
A :class:`UserWarning` will now be emitted if these are used.
:attr:`bidict.DROP_OLD` and :attr:`bidict.DROP_NEW` should be used instead.
* Rename ``DuplicationPolicy`` to :class:`~bidict.OnDupAction`
(and implement it via an :class:`~enum.Enum`).
A :class:`~bidict.OnDupAction` may be one of
:attr:`~bidict.RAISE`,
:attr:`~bidict.DROP_OLD`, or
:attr:`~bidict.DROP_NEW`.
* Expose the new :class:`~bidict.OnDup` class,
a named (*key*, *val*, *kv*) tuple of :class:`~bidict.OnDupAction`\s
that should be taken upon encountering
the 3 kinds of duplication that can occur.
* Provide the
:attr:`~bidict.ON_DUP_DEFAULT`,
:attr:`~bidict.ON_DUP_RAISE`, and
:attr:`~bidict.ON_DUP_DROP_OLD`
:class:`~bidict.OnDup` convenience instances.
* Deprecate the
``on_dup_key``, ``on_dup_val``, and ``on_dup_kv`` arguments
of :meth:`~bidict.bidict.put` and :meth:`~bidict.bidict.putall`.
A :class:`UserWarning` will now be emitted if these are used.
They have been subsumed by the new *on_dup* argument,
which takes an :class:`~bidict.OnDup` instance.
Use it like this: ``bi.put(1, 2, OnDup(key=DROP_NEW))``.
Or better yet, pass one of the
``ON_DUP_*`` convenience instances
instead if possible.
See the updated :ref:`basic-usage:Values Must Be Unique` docs for more info.
* Deprecate the
``on_dup_key``, ``on_dup_val``, and ``on_dup_kv``
bidict class attributes.
A :class:`UserWarning` will now be emitted if these are used.
They have been subsumed by the new
:attr:`~bidict.bidict.on_dup` class attribute,
which takes an :class:`~bidict.OnDup` instance.
See the updated :doc:`extending` docs for example usage.
* Move
:meth:`bidict.BidictBase.values` to
:meth:`bidict.BidirectionalMapping.values`,
since the implementation is generic.
* No longer use ``__all__`` in ``bidict/__init__.py``.
* Cap max_size rather than disabling health checks and deadline as a
less heavyhanded way to improve hypothesis test reliability on Travis.
2020-01-07 22:20:20 +00:00
|
|
|
|
:meth:`bidict.BidictBase.values` to
|
|
|
|
|
:meth:`bidict.BidirectionalMapping.values`,
|
|
|
|
|
since the implementation is generic.
|
|
|
|
|
|
2020-01-09 02:48:49 +00:00
|
|
|
|
- No longer use ``__all__`` in :mod:`bidict`'s ``__init__.py``.
|
Various API changes and other improvements.
* Deprecate ``bidict.OVERWRITE`` and ``bidict.IGNORE``.
A :class:`UserWarning` will now be emitted if these are used.
:attr:`bidict.DROP_OLD` and :attr:`bidict.DROP_NEW` should be used instead.
* Rename ``DuplicationPolicy`` to :class:`~bidict.OnDupAction`
(and implement it via an :class:`~enum.Enum`).
A :class:`~bidict.OnDupAction` may be one of
:attr:`~bidict.RAISE`,
:attr:`~bidict.DROP_OLD`, or
:attr:`~bidict.DROP_NEW`.
* Expose the new :class:`~bidict.OnDup` class,
a named (*key*, *val*, *kv*) tuple of :class:`~bidict.OnDupAction`\s
that should be taken upon encountering
the 3 kinds of duplication that can occur.
* Provide the
:attr:`~bidict.ON_DUP_DEFAULT`,
:attr:`~bidict.ON_DUP_RAISE`, and
:attr:`~bidict.ON_DUP_DROP_OLD`
:class:`~bidict.OnDup` convenience instances.
* Deprecate the
``on_dup_key``, ``on_dup_val``, and ``on_dup_kv`` arguments
of :meth:`~bidict.bidict.put` and :meth:`~bidict.bidict.putall`.
A :class:`UserWarning` will now be emitted if these are used.
They have been subsumed by the new *on_dup* argument,
which takes an :class:`~bidict.OnDup` instance.
Use it like this: ``bi.put(1, 2, OnDup(key=DROP_NEW))``.
Or better yet, pass one of the
``ON_DUP_*`` convenience instances
instead if possible.
See the updated :ref:`basic-usage:Values Must Be Unique` docs for more info.
* Deprecate the
``on_dup_key``, ``on_dup_val``, and ``on_dup_kv``
bidict class attributes.
A :class:`UserWarning` will now be emitted if these are used.
They have been subsumed by the new
:attr:`~bidict.bidict.on_dup` class attribute,
which takes an :class:`~bidict.OnDup` instance.
See the updated :doc:`extending` docs for example usage.
* Move
:meth:`bidict.BidictBase.values` to
:meth:`bidict.BidirectionalMapping.values`,
since the implementation is generic.
* No longer use ``__all__`` in ``bidict/__init__.py``.
* Cap max_size rather than disabling health checks and deadline as a
less heavyhanded way to improve hypothesis test reliability on Travis.
2020-01-07 22:20:20 +00:00
|
|
|
|
|
2019-11-04 02:54:52 +00:00
|
|
|
|
|
2019-09-22 20:38:28 +00:00
|
|
|
|
0.18.3 (2019-09-22)
|
|
|
|
|
-------------------
|
2019-09-08 21:43:53 +00:00
|
|
|
|
|
|
|
|
|
- Improve validation of names passed to :func:`~bidict.namedbidict`:
|
|
|
|
|
Use :meth:`str.isidentifier` on Python 3,
|
|
|
|
|
and a better regex on Python 2.
|
|
|
|
|
|
2019-09-08 22:15:05 +00:00
|
|
|
|
- On Python 3,
|
|
|
|
|
set :attr:`~definition.__qualname__` on :func:`~bidict.namedbidict` classes
|
|
|
|
|
based on the provided ``typename`` argument.
|
|
|
|
|
|
2019-09-08 21:43:53 +00:00
|
|
|
|
|
2019-09-08 13:00:51 +00:00
|
|
|
|
0.18.2 (2019-09-08)
|
|
|
|
|
-------------------
|
|
|
|
|
|
|
|
|
|
- Warn that Python 2 support will be dropped in a future release
|
|
|
|
|
when Python 2 is detected.
|
|
|
|
|
|
|
|
|
|
|
2019-09-03 14:56:58 +00:00
|
|
|
|
0.18.1 (2019-09-03)
|
|
|
|
|
-------------------
|
2019-09-02 21:07:03 +00:00
|
|
|
|
|
2019-09-08 13:00:51 +00:00
|
|
|
|
- Fix a regression introduced by the memory optimizations added in 0.15.0
|
2019-09-03 14:54:11 +00:00
|
|
|
|
which caused
|
|
|
|
|
:func:`deepcopied <copy.deepcopy>` and
|
|
|
|
|
:func:`unpickled <pickle.loads>`
|
|
|
|
|
bidicts to have their inverses set incorrectly.
|
2019-09-02 21:07:03 +00:00
|
|
|
|
`#94 <https://github.com/jab/bidict/issues/94>`__
|
|
|
|
|
|
|
|
|
|
|
2019-02-14 01:04:27 +00:00
|
|
|
|
0.18.0 (2019-02-14)
|
|
|
|
|
-------------------
|
2018-12-29 18:13:04 +00:00
|
|
|
|
|
2019-02-12 03:46:19 +00:00
|
|
|
|
- Rename ``bidict.BidirectionalMapping.inv`` to :attr:`~bidict.BidirectionalMapping.inverse`
|
2019-02-14 03:59:11 +00:00
|
|
|
|
and make :attr:`bidict.BidictBase.inv` an alias for :attr:`~bidict.BidictBase.inverse`.
|
2019-02-12 03:46:19 +00:00
|
|
|
|
`#86 <https://github.com/jab/bidict/issues/86>`__
|
|
|
|
|
|
|
|
|
|
- :meth:`bidict.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.
|
|
|
|
|
|
2020-07-30 13:31:03 +00:00
|
|
|
|
- Add Python 2/3-compatible ``bidict.compat.collections_abc`` alias.
|
2019-02-12 03:46:19 +00:00
|
|
|
|
|
2019-01-31 04:53:48 +00:00
|
|
|
|
- Stop testing Python 3.4 on CI,
|
|
|
|
|
and warn when Python 3 < 3.5 is detected
|
|
|
|
|
rather than Python 3 < 3.3.
|
|
|
|
|
|
2019-03-31 18:57:59 +00:00
|
|
|
|
Python 3.4 reaches `end of life <https://www.python.org/dev/peps/pep-0429/>`__ on 2019-03-18.
|
|
|
|
|
As of January 2019, 3.4 represents only about 3% of bidict downloads on
|
|
|
|
|
`PyPI Stats <https://pypistats.org/packages/bidict>`__.
|
2019-01-31 04:53:48 +00:00
|
|
|
|
|
2018-12-29 18:13:04 +00:00
|
|
|
|
|
2018-11-19 14:37:38 +00:00
|
|
|
|
0.17.5 (2018-11-19)
|
|
|
|
|
-------------------
|
|
|
|
|
|
|
|
|
|
Improvements to performance and delegation logic,
|
|
|
|
|
with minor breaking changes to semi-private APIs.
|
|
|
|
|
|
|
|
|
|
- Remove the ``__delegate__`` instance attribute added in the previous release.
|
|
|
|
|
It was overly general and not worth the cost.
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
|
as :class:`bidict.MutableBidict`.
|
|
|
|
|
|
|
|
|
|
- Rename ``__repr_delegate__`` to
|
|
|
|
|
:class:`~bidict.BidictBase._repr_delegate`.
|
|
|
|
|
|
|
|
|
|
|
2018-11-14 02:51:15 +00:00
|
|
|
|
0.17.4 (2018-11-14)
|
|
|
|
|
-------------------
|
2018-11-05 20:52:59 +00:00
|
|
|
|
|
|
|
|
|
Minor code, interop, and (semi-)private API improvements.
|
|
|
|
|
|
2018-11-06 21:10:03 +00:00
|
|
|
|
- :class:`~bidict.OrderedBidict` optimizations and code improvements.
|
|
|
|
|
|
|
|
|
|
Use ``bidict``\s for the backing ``_fwdm`` and ``_invm`` mappings,
|
|
|
|
|
obviating the need to store key and value data in linked list nodes.
|
|
|
|
|
|
2018-11-05 20:52:59 +00:00
|
|
|
|
- Refactor proxied- (i.e. delegated-) to-``_fwdm`` logic
|
|
|
|
|
for better composability and interoperability.
|
|
|
|
|
|
|
|
|
|
Drop the ``_Proxied*`` mixin classes
|
|
|
|
|
and instead move their methods
|
|
|
|
|
into :class:`~bidict.BidictBase`,
|
|
|
|
|
which now checks for an object defined by the
|
2018-11-19 14:37:38 +00:00
|
|
|
|
``BidictBase.__delegate__`` attribute.
|
|
|
|
|
The ``BidictBase.__delegate__`` object
|
2018-11-05 20:52:59 +00:00
|
|
|
|
will be delegated to if the method is available on it,
|
|
|
|
|
otherwise a default implementation
|
|
|
|
|
(e.g. inherited from :class:`~collections.abc.Mapping`)
|
|
|
|
|
will be used otherwise.
|
|
|
|
|
Subclasses may set ``__delegate__ = None`` to opt out.
|
|
|
|
|
|
|
|
|
|
Consolidate ``_MutableBidict`` into :class:`bidict.bidict`
|
|
|
|
|
now that the dropped mixin classes make it unnecessary.
|
|
|
|
|
|
2018-11-19 14:37:38 +00:00
|
|
|
|
- Change ``__repr_delegate__``
|
|
|
|
|
to simply take a type like :class:`dict` or :class:`list`.
|
2018-11-05 20:52:59 +00:00
|
|
|
|
|
|
|
|
|
- Upgrade to latest major
|
|
|
|
|
`sortedcontainers <https://github.com/grantjenks/python-sortedcontainers>`__
|
|
|
|
|
version (from v1 to v2)
|
2020-01-11 03:31:17 +00:00
|
|
|
|
for the :ref:`extending:\`\`SortedBidict\`\` Recipes`.
|
2018-11-05 20:52:59 +00:00
|
|
|
|
|
2018-11-14 02:38:59 +00:00
|
|
|
|
- ``bidict.compat.{view,iter}{keys,values,items}`` on Python 2
|
2018-11-05 20:52:59 +00:00
|
|
|
|
no longer assumes the target object implements these methods,
|
|
|
|
|
as they're not actually part of the
|
|
|
|
|
:class:`~collections.abc.Mapping` interface,
|
|
|
|
|
and provides fallback implementations when the methods are unavailable.
|
2020-01-11 03:31:17 +00:00
|
|
|
|
This allows the :ref:`extending:\`\`SortedBidict\`\` Recipes`
|
2018-11-19 14:37:38 +00:00
|
|
|
|
to continue to work with sortedcontainers v2 on Python 2.
|
2018-11-05 20:52:59 +00:00
|
|
|
|
|
|
|
|
|
|
2018-09-18 20:55:54 +00:00
|
|
|
|
0.17.3 (2018-09-18)
|
|
|
|
|
-------------------
|
2018-08-17 04:22:17 +00:00
|
|
|
|
|
2018-09-17 23:23:46 +00:00
|
|
|
|
- Improve packaging by adding a pyproject.toml
|
2018-09-17 23:35:35 +00:00
|
|
|
|
and by including more supporting files in the distribution.
|
2019-09-03 14:54:11 +00:00
|
|
|
|
`#81 <https://github.com/jab/bidict/pull/81>`__
|
2018-08-17 04:22:17 +00:00
|
|
|
|
|
2018-09-18 00:03:52 +00:00
|
|
|
|
- Drop pytest-runner and support for running tests via ``python setup.py test``
|
|
|
|
|
in preference to ``pytest`` or ``python -m pytest``.
|
|
|
|
|
|
2018-08-17 04:22:17 +00:00
|
|
|
|
|
2018-04-30 04:18:42 +00:00
|
|
|
|
0.17.2 (2018-04-30)
|
|
|
|
|
-------------------
|
|
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
|
|
|
|
|
2018-04-28 03:05:57 +00:00
|
|
|
|
0.17.1 (2018-04-28)
|
|
|
|
|
-------------------
|
2018-04-28 01:50:29 +00:00
|
|
|
|
|
|
|
|
|
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``.
|
|
|
|
|
|
|
|
|
|
|
2018-04-25 16:29:54 +00:00
|
|
|
|
0.17.0 (2018-04-25)
|
|
|
|
|
-------------------
|
2018-04-19 08:22:07 +00:00
|
|
|
|
|
2018-04-25 14:34:27 +00:00
|
|
|
|
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`.
|
2018-04-21 22:09:36 +00:00
|
|
|
|
|
|
|
|
|
- Use weakrefs in the linked lists that back
|
|
|
|
|
:class:`~bidict.OrderedBidict`\s
|
|
|
|
|
to avoid creating strong reference cycles.
|
|
|
|
|
|
|
|
|
|
Memory for an ordered 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 until the next garbage collection.
|
|
|
|
|
`#71 <https://github.com/jab/bidict/pull/71>`__
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Misc
|
|
|
|
|
++++
|
|
|
|
|
|
2020-12-20 15:40:40 +00:00
|
|
|
|
- Add ``bidict.__version_info__`` attribute
|
2018-04-21 22:09:36 +00:00
|
|
|
|
to complement :attr:`bidict.__version__`.
|
2018-04-19 08:22:07 +00:00
|
|
|
|
|
|
|
|
|
|
2018-04-06 04:32:00 +00:00
|
|
|
|
0.16.0 (2018-04-06)
|
|
|
|
|
-------------------
|
2018-04-06 04:28:44 +00:00
|
|
|
|
|
|
|
|
|
Minor code and efficiency improvements to
|
|
|
|
|
:func:`~bidict.inverted` and
|
2020-08-01 18:26:08 +00:00
|
|
|
|
:func:`~bidict._iter._iteritems_args_kw`
|
2018-04-06 04:28:44 +00:00
|
|
|
|
(formerly ``bidict.pairs()``).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Minor Breaking API Changes
|
|
|
|
|
++++++++++++++++++++++++++
|
|
|
|
|
|
|
|
|
|
The following breaking changes are expected to affect few if any users.
|
|
|
|
|
|
2020-08-01 18:26:08 +00:00
|
|
|
|
- Rename ``bidict.pairs()`` → ``bidict._util._iteritems_args_kw``.
|
2016-06-28 04:05:22 +00:00
|
|
|
|
|
|
|
|
|
|
2018-03-29 03:11:32 +00:00
|
|
|
|
0.15.0 (2018-03-29)
|
|
|
|
|
-------------------
|
2018-03-02 01:59:15 +00:00
|
|
|
|
|
2018-02-24 09:14:42 +00:00
|
|
|
|
Speedups and memory usage improvements
|
|
|
|
|
++++++++++++++++++++++++++++++++++++++
|
|
|
|
|
|
2018-02-19 02:40:01 +00:00
|
|
|
|
- Use :ref:`slots` to speed up bidict attribute access and reduce memory usage.
|
2018-02-24 09:14:42 +00:00
|
|
|
|
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
|
2018-04-06 04:28:44 +00:00
|
|
|
|
`benchmark <https://github.com/jab/bidict/pull/56#issuecomment-368203591>`__.
|
2018-02-19 02:40:01 +00:00
|
|
|
|
|
2017-12-07 17:57:01 +00:00
|
|
|
|
- Use weakrefs to refer to a bidict's inverse internally,
|
2018-01-17 00:43:39 +00:00
|
|
|
|
no longer creating a strong reference cycle.
|
2017-12-07 17:57:01 +00:00
|
|
|
|
Memory for a bidict that you create can now be reclaimed
|
2018-04-21 22:09:36 +00:00
|
|
|
|
in CPython as soon as you no longer hold any references to it,
|
|
|
|
|
rather than having to wait for the next garbage collection.
|
2018-04-06 04:28:44 +00:00
|
|
|
|
See the new
|
2020-01-11 03:31:17 +00:00
|
|
|
|
:ref:`addendum:\`\`bidict\`\` Avoids Reference Cycles`
|
2018-04-06 04:28:44 +00:00
|
|
|
|
documentation.
|
2019-09-03 14:54:11 +00:00
|
|
|
|
`#24 <https://github.com/jab/bidict/issues/20>`__
|
2017-12-07 17:57:01 +00:00
|
|
|
|
|
2018-02-26 23:29:56 +00:00
|
|
|
|
- Make :func:`bidict.BidictBase.__eq__` significantly
|
2018-02-24 09:14:42 +00:00
|
|
|
|
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.
|
2018-01-09 17:08:58 +00:00
|
|
|
|
|
2018-02-26 23:29:56 +00:00
|
|
|
|
- Make :func:`bidict.OrderedBidictBase.__iter__` as well as
|
2018-02-25 23:44:21 +00:00
|
|
|
|
equality comparison slightly faster for ordered bidicts.
|
2018-02-13 01:34:33 +00:00
|
|
|
|
|
2018-03-01 03:18:39 +00:00
|
|
|
|
Minor Bugfixes
|
|
|
|
|
++++++++++++++
|
2018-02-13 01:34:33 +00:00
|
|
|
|
|
2018-02-27 13:09:57 +00:00
|
|
|
|
- :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`.
|
|
|
|
|
|
2018-02-19 13:07:14 +00:00
|
|
|
|
- If you create a custom bidict subclass whose ``_fwdm_cls``
|
|
|
|
|
differs from its ``_invm_cls``
|
|
|
|
|
(as in the ``FwdKeySortedBidict`` example
|
2020-01-11 03:31:17 +00:00
|
|
|
|
from the :ref:`extending:\`\`SortedBidict\`\` Recipes`),
|
2018-02-19 13:07:14 +00:00
|
|
|
|
the inverse bidirectional mapping type
|
|
|
|
|
(with ``_fwdm_cls`` and ``_invm_cls`` swapped)
|
|
|
|
|
is now correctly computed and used automatically
|
|
|
|
|
for your custom bidict's
|
2019-02-12 03:46:19 +00:00
|
|
|
|
:attr:`~bidict.BidictBase.inverse` bidict.
|
2018-02-19 13:07:14 +00:00
|
|
|
|
|
2018-02-24 09:14:42 +00:00
|
|
|
|
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.
|
|
|
|
|
|
2018-02-26 23:29:56 +00:00
|
|
|
|
- :func:`~bidict.BidictBase.__repr__` no longer checks for a ``__reversed__``
|
2018-02-24 09:14:42 +00:00
|
|
|
|
method to determine whether to use an ordered or unordered-style repr.
|
2018-11-19 14:37:38 +00:00
|
|
|
|
It now calls the new ``__repr_delegate__`` instead
|
2018-02-24 09:14:42 +00:00
|
|
|
|
(which may be overridden if needed), for better composability.
|
|
|
|
|
|
|
|
|
|
Minor Breaking API Changes
|
|
|
|
|
++++++++++++++++++++++++++
|
2018-02-13 01:34:33 +00:00
|
|
|
|
|
2018-02-24 09:14:42 +00:00
|
|
|
|
The following breaking changes are expected to affect few if any users.
|
2017-12-07 17:57:01 +00:00
|
|
|
|
|
2018-02-26 23:29:56 +00:00
|
|
|
|
- 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,
|
2018-02-27 13:09:57 +00:00
|
|
|
|
so this change restores ``issubclass(bidict, frozenbidict) == False``.
|
|
|
|
|
|
2018-04-06 04:28:44 +00:00
|
|
|
|
See the updated :ref:`other-bidict-types:Bidict Types Diagram`
|
|
|
|
|
and :ref:`other-bidict-types:Polymorphism` documentation.
|
2018-02-26 23:29:56 +00:00
|
|
|
|
|
2018-02-20 10:23:04 +00:00
|
|
|
|
- Rename:
|
2018-03-01 03:18:39 +00:00
|
|
|
|
|
2018-02-26 23:29:56 +00:00
|
|
|
|
- ``bidict.BidictBase.fwdm`` → ``._fwdm``
|
|
|
|
|
- ``bidict.BidictBase.invm`` → ``._invm``
|
|
|
|
|
- ``bidict.BidictBase.fwd_cls`` → ``._fwdm_cls``
|
|
|
|
|
- ``bidict.BidictBase.inv_cls`` → ``._invm_cls``
|
|
|
|
|
- ``bidict.BidictBase.isinv`` → ``._isinv``
|
2018-02-20 10:23:04 +00:00
|
|
|
|
|
|
|
|
|
Though overriding ``_fwdm_cls`` and ``_invm_cls`` remains supported
|
2018-04-06 04:28:44 +00:00
|
|
|
|
(see :doc:`extending`),
|
2018-02-20 10:23:04 +00:00
|
|
|
|
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`,
|
Various API changes and other improvements.
* Deprecate ``bidict.OVERWRITE`` and ``bidict.IGNORE``.
A :class:`UserWarning` will now be emitted if these are used.
:attr:`bidict.DROP_OLD` and :attr:`bidict.DROP_NEW` should be used instead.
* Rename ``DuplicationPolicy`` to :class:`~bidict.OnDupAction`
(and implement it via an :class:`~enum.Enum`).
A :class:`~bidict.OnDupAction` may be one of
:attr:`~bidict.RAISE`,
:attr:`~bidict.DROP_OLD`, or
:attr:`~bidict.DROP_NEW`.
* Expose the new :class:`~bidict.OnDup` class,
a named (*key*, *val*, *kv*) tuple of :class:`~bidict.OnDupAction`\s
that should be taken upon encountering
the 3 kinds of duplication that can occur.
* Provide the
:attr:`~bidict.ON_DUP_DEFAULT`,
:attr:`~bidict.ON_DUP_RAISE`, and
:attr:`~bidict.ON_DUP_DROP_OLD`
:class:`~bidict.OnDup` convenience instances.
* Deprecate the
``on_dup_key``, ``on_dup_val``, and ``on_dup_kv`` arguments
of :meth:`~bidict.bidict.put` and :meth:`~bidict.bidict.putall`.
A :class:`UserWarning` will now be emitted if these are used.
They have been subsumed by the new *on_dup* argument,
which takes an :class:`~bidict.OnDup` instance.
Use it like this: ``bi.put(1, 2, OnDup(key=DROP_NEW))``.
Or better yet, pass one of the
``ON_DUP_*`` convenience instances
instead if possible.
See the updated :ref:`basic-usage:Values Must Be Unique` docs for more info.
* Deprecate the
``on_dup_key``, ``on_dup_val``, and ``on_dup_kv``
bidict class attributes.
A :class:`UserWarning` will now be emitted if these are used.
They have been subsumed by the new
:attr:`~bidict.bidict.on_dup` class attribute,
which takes an :class:`~bidict.OnDup` instance.
See the updated :doc:`extending` docs for example usage.
* Move
:meth:`bidict.BidictBase.values` to
:meth:`bidict.BidirectionalMapping.values`,
since the implementation is generic.
* No longer use ``__all__`` in ``bidict/__init__.py``.
* Cap max_size rather than disabling health checks and deadline as a
less heavyhanded way to improve hypothesis test reliability on Travis.
2020-01-07 22:20:20 +00:00
|
|
|
|
``OVERWRITE``, and ``IGNORE``
|
2018-02-20 10:23:04 +00:00
|
|
|
|
duplication policies are no longer available as attributes of
|
Various API changes and other improvements.
* Deprecate ``bidict.OVERWRITE`` and ``bidict.IGNORE``.
A :class:`UserWarning` will now be emitted if these are used.
:attr:`bidict.DROP_OLD` and :attr:`bidict.DROP_NEW` should be used instead.
* Rename ``DuplicationPolicy`` to :class:`~bidict.OnDupAction`
(and implement it via an :class:`~enum.Enum`).
A :class:`~bidict.OnDupAction` may be one of
:attr:`~bidict.RAISE`,
:attr:`~bidict.DROP_OLD`, or
:attr:`~bidict.DROP_NEW`.
* Expose the new :class:`~bidict.OnDup` class,
a named (*key*, *val*, *kv*) tuple of :class:`~bidict.OnDupAction`\s
that should be taken upon encountering
the 3 kinds of duplication that can occur.
* Provide the
:attr:`~bidict.ON_DUP_DEFAULT`,
:attr:`~bidict.ON_DUP_RAISE`, and
:attr:`~bidict.ON_DUP_DROP_OLD`
:class:`~bidict.OnDup` convenience instances.
* Deprecate the
``on_dup_key``, ``on_dup_val``, and ``on_dup_kv`` arguments
of :meth:`~bidict.bidict.put` and :meth:`~bidict.bidict.putall`.
A :class:`UserWarning` will now be emitted if these are used.
They have been subsumed by the new *on_dup* argument,
which takes an :class:`~bidict.OnDup` instance.
Use it like this: ``bi.put(1, 2, OnDup(key=DROP_NEW))``.
Or better yet, pass one of the
``ON_DUP_*`` convenience instances
instead if possible.
See the updated :ref:`basic-usage:Values Must Be Unique` docs for more info.
* Deprecate the
``on_dup_key``, ``on_dup_val``, and ``on_dup_kv``
bidict class attributes.
A :class:`UserWarning` will now be emitted if these are used.
They have been subsumed by the new
:attr:`~bidict.bidict.on_dup` class attribute,
which takes an :class:`~bidict.OnDup` instance.
See the updated :doc:`extending` docs for example usage.
* Move
:meth:`bidict.BidictBase.values` to
:meth:`bidict.BidirectionalMapping.values`,
since the implementation is generic.
* No longer use ``__all__`` in ``bidict/__init__.py``.
* Cap max_size rather than disabling health checks and deadline as a
less heavyhanded way to improve hypothesis test reliability on Travis.
2020-01-07 22:20:20 +00:00
|
|
|
|
``DuplicationPolicy``,
|
2018-02-24 09:14:42 +00:00
|
|
|
|
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...``
|
2018-02-19 02:40:01 +00:00
|
|
|
|
|
2018-04-06 04:28:44 +00:00
|
|
|
|
- Make ``bidict.pairs()`` and :func:`bidict.inverted`
|
2018-03-01 03:18:39 +00:00
|
|
|
|
no longer importable from ``bidict.util``,
|
|
|
|
|
and now only importable from the top-level :mod:`bidict` module.
|
|
|
|
|
(``bidict.util`` was renamed ``bidict._util``.)
|
|
|
|
|
|
2018-02-19 05:57:42 +00:00
|
|
|
|
- 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)``.
|
2018-02-19 02:40:01 +00:00
|
|
|
|
|
2017-12-07 17:57:01 +00:00
|
|
|
|
|
2017-12-06 19:22:32 +00:00
|
|
|
|
0.14.2 (2017-12-06)
|
|
|
|
|
-------------------
|
|
|
|
|
|
|
|
|
|
- Make initializing (or updating an empty bidict) from only another
|
2018-01-02 21:49:34 +00:00
|
|
|
|
:class:`~bidict.BidirectionalMapping`
|
2017-12-06 19:22:32 +00:00
|
|
|
|
more efficient by skipping unnecessary duplication checking.
|
|
|
|
|
|
|
|
|
|
- Fix accidental ignoring of specified ``base_type`` argument
|
2018-01-02 21:49:34 +00:00
|
|
|
|
when (un)pickling a :func:`~bidict.namedbidict`.
|
2017-12-06 19:22:32 +00:00
|
|
|
|
|
|
|
|
|
- Fix incorrect inversion of
|
2018-02-24 09:14:42 +00:00
|
|
|
|
``some_named_bidict.inv.<fwdname>_for`` and
|
|
|
|
|
``some_named_bidict.inv.<invname>_for``.
|
2017-12-06 19:22:32 +00:00
|
|
|
|
|
|
|
|
|
- Only warn when an unsupported Python version is detected
|
|
|
|
|
(e.g. Python < 2.7) rather than raising :class:`AssertionError`.
|
|
|
|
|
|
|
|
|
|
|
2017-11-29 02:27:36 +00:00
|
|
|
|
0.14.1 (2017-11-28)
|
|
|
|
|
-------------------
|
2017-11-29 01:56:50 +00:00
|
|
|
|
|
|
|
|
|
- Fix a bug introduced in 0.14.0 where hashing a
|
2018-01-02 21:49:34 +00:00
|
|
|
|
:class:`~bidict.frozenbidict`\’s inverse
|
2017-11-29 01:56:50 +00:00
|
|
|
|
(e.g. ``f = frozenbidict(); {f.inv: '...'}``)
|
|
|
|
|
would cause an ``AttributeError``.
|
|
|
|
|
|
2018-02-26 23:29:56 +00:00
|
|
|
|
- Fix a bug introduced in 0.14.0 for Python 2 users
|
2018-04-06 04:28:44 +00:00
|
|
|
|
where attempting to call ``viewitems()``
|
2017-11-29 01:56:50 +00:00
|
|
|
|
would cause a ``TypeError``.
|
2019-09-03 14:54:11 +00:00
|
|
|
|
`#48 <https://github.com/jab/bidict/issues/48>`__
|
2017-11-29 01:36:39 +00:00
|
|
|
|
|
|
|
|
|
|
2017-11-21 04:49:12 +00:00
|
|
|
|
0.14.0 (2017-11-20)
|
|
|
|
|
-------------------
|
2017-03-15 20:50:22 +00:00
|
|
|
|
|
2018-01-02 21:49:34 +00:00
|
|
|
|
- Fix a bug where :class:`~bidict.bidict`\’s
|
2018-02-20 10:23:04 +00:00
|
|
|
|
default *on_dup_kv* policy was set to :attr:`~bidict.RAISE`,
|
2017-11-21 03:27:26 +00:00
|
|
|
|
rather than matching whatever *on_dup_val* policy was in effect
|
2018-04-06 04:28:44 +00:00
|
|
|
|
as was :ref:`documented <basic-usage:Key and Value Duplication>`.
|
2017-11-18 03:35:40 +00:00
|
|
|
|
|
2017-11-21 03:27:26 +00:00
|
|
|
|
- Fix a bug that could happen when using Python's optimization (``-O``) flag
|
2017-11-20 03:24:08 +00:00
|
|
|
|
that could leave an ordered bidict in an inconsistent state
|
|
|
|
|
when dealing with duplicated, overwritten keys or values.
|
2017-11-21 03:27:26 +00:00
|
|
|
|
If you do not use optimizations
|
|
|
|
|
(specifically, skipping ``assert`` statements),
|
|
|
|
|
this would not have affected you.
|
2017-11-18 03:35:40 +00:00
|
|
|
|
|
2017-11-21 03:27:26 +00:00
|
|
|
|
- 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.
|
|
|
|
|
|
2018-02-26 23:29:56 +00:00
|
|
|
|
- Add :meth:`~bidict.OrderedBidictBase.equals_order_sensitive`.
|
2017-11-18 03:35:40 +00:00
|
|
|
|
|
2017-11-20 03:24:08 +00:00
|
|
|
|
- Reduce the memory usage of ordered bidicts.
|
2017-11-18 03:35:40 +00:00
|
|
|
|
|
2017-11-20 03:24:08 +00:00
|
|
|
|
- Make copying of ordered bidicts faster.
|
2017-11-18 03:35:40 +00:00
|
|
|
|
|
|
|
|
|
- Improvements to tests and CI, including:
|
2017-11-16 20:44:51 +00:00
|
|
|
|
|
2017-11-21 03:27:26 +00:00
|
|
|
|
- Test on Windows
|
2017-11-16 20:44:51 +00:00
|
|
|
|
- Test with PyPy3
|
|
|
|
|
- Test with CPython 3.7-dev
|
2017-11-18 03:35:40 +00:00
|
|
|
|
- Test with optimization flags
|
|
|
|
|
- Require pylint to pass
|
2017-11-16 20:44:51 +00:00
|
|
|
|
|
2017-11-20 03:24:08 +00:00
|
|
|
|
|
2017-11-16 20:44:51 +00:00
|
|
|
|
Breaking API Changes
|
|
|
|
|
++++++++++++++++++++
|
|
|
|
|
|
2017-11-20 03:24:08 +00:00
|
|
|
|
This release includes multiple API simplifications and improvements.
|
|
|
|
|
|
2017-11-21 03:27:26 +00:00
|
|
|
|
- Rename:
|
2017-11-20 03:24:08 +00:00
|
|
|
|
|
2018-04-06 04:28:44 +00:00
|
|
|
|
- ``orderedbidict`` → :class:`~bidict.OrderedBidict`
|
|
|
|
|
- ``frozenorderedbidict`` → :class:`~bidict.FrozenOrderedBidict`
|
2017-11-20 03:24:08 +00:00
|
|
|
|
|
|
|
|
|
so that these now match the case of :class:`collections.OrderedDict`.
|
|
|
|
|
|
|
|
|
|
The names of the
|
2018-01-02 21:49:34 +00:00
|
|
|
|
:class:`~bidict.bidict`,
|
|
|
|
|
:func:`~bidict.namedbidict`, and
|
|
|
|
|
:class:`~bidict.frozenbidict` classes
|
2017-11-20 03:24:08 +00:00
|
|
|
|
have been retained as all-lowercase
|
|
|
|
|
so that they continue to match the case of
|
2018-01-02 21:49:34 +00:00
|
|
|
|
:class:`dict`, :func:`~collections.namedtuple`, and
|
2017-11-20 03:24:08 +00:00
|
|
|
|
:class:`frozenset`, respectively.
|
|
|
|
|
|
2017-11-21 03:27:26 +00:00
|
|
|
|
- The ``ON_DUP_VAL`` duplication policy value for *on_dup_kv* has been removed.
|
2017-11-20 03:24:08 +00:00
|
|
|
|
Use ``None`` instead.
|
|
|
|
|
|
2018-01-02 21:49:34 +00:00
|
|
|
|
- Merge :class:`~bidict.frozenbidict` and ``BidictBase``
|
2017-11-20 03:24:08 +00:00
|
|
|
|
together and remove ``BidictBase``.
|
2018-01-02 21:49:34 +00:00
|
|
|
|
:class:`~bidict.frozenbidict`
|
2017-11-20 03:24:08 +00:00
|
|
|
|
is now the concrete base class that all other bidict types derive from.
|
2018-04-06 04:28:44 +00:00
|
|
|
|
See the updated :ref:`other-bidict-types:Bidict Types Diagram`.
|
2017-11-20 03:24:08 +00:00
|
|
|
|
|
2018-01-02 21:49:34 +00:00
|
|
|
|
- Merge :class:`~bidict.frozenbidict` and ``FrozenBidictBase``
|
2017-11-20 03:24:08 +00:00
|
|
|
|
together and remove ``FrozenBidictBase``.
|
2018-04-06 04:28:44 +00:00
|
|
|
|
See the updated :ref:`other-bidict-types:Bidict Types Diagram`.
|
2017-11-20 03:24:08 +00:00
|
|
|
|
|
|
|
|
|
- Merge ``frozenorderedbidict`` and ``OrderedBidictBase`` together
|
2018-01-02 21:49:34 +00:00
|
|
|
|
into a single :class:`~bidict.FrozenOrderedBidict`
|
2017-11-21 03:27:26 +00:00
|
|
|
|
class and remove ``OrderedBidictBase``.
|
2018-01-02 21:49:34 +00:00
|
|
|
|
:class:`~bidict.OrderedBidict` now extends
|
|
|
|
|
:class:`~bidict.FrozenOrderedBidict`
|
2017-11-21 03:27:26 +00:00
|
|
|
|
to add mutable behavior.
|
2018-04-06 04:28:44 +00:00
|
|
|
|
See the updated :ref:`other-bidict-types:Bidict Types Diagram`.
|
2017-11-20 03:24:08 +00:00
|
|
|
|
|
2018-02-26 23:29:56 +00:00
|
|
|
|
- Make :meth:`~bidict.OrderedBidictBase.__eq__`
|
2017-11-21 03:27:26 +00:00
|
|
|
|
always perform an order-insensitive equality test,
|
|
|
|
|
even if the other mapping is ordered.
|
2017-11-20 03:24:08 +00:00
|
|
|
|
|
|
|
|
|
Previously,
|
2018-02-26 23:29:56 +00:00
|
|
|
|
:meth:`~bidict.OrderedBidictBase.__eq__`
|
2017-11-21 03:27:26 +00:00
|
|
|
|
was only order-sensitive for other ``OrderedBidictBase`` subclasses,
|
|
|
|
|
and order-insensitive otherwise.
|
|
|
|
|
|
2018-02-26 23:29:56 +00:00
|
|
|
|
Use the new :meth:`~bidict.OrderedBidictBase.equals_order_sensitive`
|
2017-11-21 03:27:26 +00:00
|
|
|
|
method for order-sensitive equality comparison.
|
2017-11-20 03:24:08 +00:00
|
|
|
|
|
2017-11-21 03:27:26 +00:00
|
|
|
|
- ``orderedbidict._should_compare_order_sensitive()`` has been removed.
|
2017-11-20 03:24:08 +00:00
|
|
|
|
|
|
|
|
|
- ``frozenorderedbidict._HASH_NITEMS_MAX`` has been removed.
|
2017-11-18 03:35:40 +00:00
|
|
|
|
Since its hash value must be computed from all contained items
|
2017-11-20 03:24:08 +00:00
|
|
|
|
(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.
|
2017-11-18 03:35:40 +00:00
|
|
|
|
|
2017-11-20 03:24:08 +00:00
|
|
|
|
- ``frozenbidict._USE_ITEMSVIEW_HASH`` has been removed, and
|
2018-01-02 21:49:34 +00:00
|
|
|
|
``frozenbidict.compute_hash()``
|
2017-11-20 03:24:08 +00:00
|
|
|
|
now uses ``collections.ItemsView._hash()`` to compute the hash always,
|
2017-11-18 03:35:40 +00:00
|
|
|
|
not just when running on PyPy.
|
|
|
|
|
|
2018-01-02 21:49:34 +00:00
|
|
|
|
Override ``frozenbidict.compute_hash()``
|
2017-11-18 03:35:40 +00:00
|
|
|
|
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.
|
|
|
|
|
|
2017-11-20 03:24:08 +00:00
|
|
|
|
- ``loosebidict`` and ``looseorderedbidict`` have been removed.
|
2018-04-06 04:28:44 +00:00
|
|
|
|
A simple recipe to implement equivalents yourself is now given in
|
Various API changes and other improvements.
* Deprecate ``bidict.OVERWRITE`` and ``bidict.IGNORE``.
A :class:`UserWarning` will now be emitted if these are used.
:attr:`bidict.DROP_OLD` and :attr:`bidict.DROP_NEW` should be used instead.
* Rename ``DuplicationPolicy`` to :class:`~bidict.OnDupAction`
(and implement it via an :class:`~enum.Enum`).
A :class:`~bidict.OnDupAction` may be one of
:attr:`~bidict.RAISE`,
:attr:`~bidict.DROP_OLD`, or
:attr:`~bidict.DROP_NEW`.
* Expose the new :class:`~bidict.OnDup` class,
a named (*key*, *val*, *kv*) tuple of :class:`~bidict.OnDupAction`\s
that should be taken upon encountering
the 3 kinds of duplication that can occur.
* Provide the
:attr:`~bidict.ON_DUP_DEFAULT`,
:attr:`~bidict.ON_DUP_RAISE`, and
:attr:`~bidict.ON_DUP_DROP_OLD`
:class:`~bidict.OnDup` convenience instances.
* Deprecate the
``on_dup_key``, ``on_dup_val``, and ``on_dup_kv`` arguments
of :meth:`~bidict.bidict.put` and :meth:`~bidict.bidict.putall`.
A :class:`UserWarning` will now be emitted if these are used.
They have been subsumed by the new *on_dup* argument,
which takes an :class:`~bidict.OnDup` instance.
Use it like this: ``bi.put(1, 2, OnDup(key=DROP_NEW))``.
Or better yet, pass one of the
``ON_DUP_*`` convenience instances
instead if possible.
See the updated :ref:`basic-usage:Values Must Be Unique` docs for more info.
* Deprecate the
``on_dup_key``, ``on_dup_val``, and ``on_dup_kv``
bidict class attributes.
A :class:`UserWarning` will now be emitted if these are used.
They have been subsumed by the new
:attr:`~bidict.bidict.on_dup` class attribute,
which takes an :class:`~bidict.OnDup` instance.
See the updated :doc:`extending` docs for example usage.
* Move
:meth:`bidict.BidictBase.values` to
:meth:`bidict.BidirectionalMapping.values`,
since the implementation is generic.
* No longer use ``__all__`` in ``bidict/__init__.py``.
* Cap max_size rather than disabling health checks and deadline as a
less heavyhanded way to improve hypothesis test reliability on Travis.
2020-01-07 22:20:20 +00:00
|
|
|
|
:doc:`extending`.
|
2017-11-20 03:24:08 +00:00
|
|
|
|
|
2017-11-21 03:27:26 +00:00
|
|
|
|
- Rename ``FrozenBidictBase._compute_hash()`` →
|
2018-02-19 13:07:14 +00:00
|
|
|
|
``frozenbidict.compute_hash()``.
|
2017-11-20 03:24:08 +00:00
|
|
|
|
|
Various API changes and other improvements.
* Deprecate ``bidict.OVERWRITE`` and ``bidict.IGNORE``.
A :class:`UserWarning` will now be emitted if these are used.
:attr:`bidict.DROP_OLD` and :attr:`bidict.DROP_NEW` should be used instead.
* Rename ``DuplicationPolicy`` to :class:`~bidict.OnDupAction`
(and implement it via an :class:`~enum.Enum`).
A :class:`~bidict.OnDupAction` may be one of
:attr:`~bidict.RAISE`,
:attr:`~bidict.DROP_OLD`, or
:attr:`~bidict.DROP_NEW`.
* Expose the new :class:`~bidict.OnDup` class,
a named (*key*, *val*, *kv*) tuple of :class:`~bidict.OnDupAction`\s
that should be taken upon encountering
the 3 kinds of duplication that can occur.
* Provide the
:attr:`~bidict.ON_DUP_DEFAULT`,
:attr:`~bidict.ON_DUP_RAISE`, and
:attr:`~bidict.ON_DUP_DROP_OLD`
:class:`~bidict.OnDup` convenience instances.
* Deprecate the
``on_dup_key``, ``on_dup_val``, and ``on_dup_kv`` arguments
of :meth:`~bidict.bidict.put` and :meth:`~bidict.bidict.putall`.
A :class:`UserWarning` will now be emitted if these are used.
They have been subsumed by the new *on_dup* argument,
which takes an :class:`~bidict.OnDup` instance.
Use it like this: ``bi.put(1, 2, OnDup(key=DROP_NEW))``.
Or better yet, pass one of the
``ON_DUP_*`` convenience instances
instead if possible.
See the updated :ref:`basic-usage:Values Must Be Unique` docs for more info.
* Deprecate the
``on_dup_key``, ``on_dup_val``, and ``on_dup_kv``
bidict class attributes.
A :class:`UserWarning` will now be emitted if these are used.
They have been subsumed by the new
:attr:`~bidict.bidict.on_dup` class attribute,
which takes an :class:`~bidict.OnDup` instance.
See the updated :doc:`extending` docs for example usage.
* Move
:meth:`bidict.BidictBase.values` to
:meth:`bidict.BidirectionalMapping.values`,
since the implementation is generic.
* No longer use ``__all__`` in ``bidict/__init__.py``.
* Cap max_size rather than disabling health checks and deadline as a
less heavyhanded way to improve hypothesis test reliability on Travis.
2020-01-07 22:20:20 +00:00
|
|
|
|
- Rename ``DuplicationBehavior`` → ``DuplicationPolicy``.
|
2017-11-20 03:24:08 +00:00
|
|
|
|
|
2017-11-21 03:27:26 +00:00
|
|
|
|
- Rename:
|
2017-11-18 03:35:40 +00:00
|
|
|
|
|
Various API changes and other improvements.
* Deprecate ``bidict.OVERWRITE`` and ``bidict.IGNORE``.
A :class:`UserWarning` will now be emitted if these are used.
:attr:`bidict.DROP_OLD` and :attr:`bidict.DROP_NEW` should be used instead.
* Rename ``DuplicationPolicy`` to :class:`~bidict.OnDupAction`
(and implement it via an :class:`~enum.Enum`).
A :class:`~bidict.OnDupAction` may be one of
:attr:`~bidict.RAISE`,
:attr:`~bidict.DROP_OLD`, or
:attr:`~bidict.DROP_NEW`.
* Expose the new :class:`~bidict.OnDup` class,
a named (*key*, *val*, *kv*) tuple of :class:`~bidict.OnDupAction`\s
that should be taken upon encountering
the 3 kinds of duplication that can occur.
* Provide the
:attr:`~bidict.ON_DUP_DEFAULT`,
:attr:`~bidict.ON_DUP_RAISE`, and
:attr:`~bidict.ON_DUP_DROP_OLD`
:class:`~bidict.OnDup` convenience instances.
* Deprecate the
``on_dup_key``, ``on_dup_val``, and ``on_dup_kv`` arguments
of :meth:`~bidict.bidict.put` and :meth:`~bidict.bidict.putall`.
A :class:`UserWarning` will now be emitted if these are used.
They have been subsumed by the new *on_dup* argument,
which takes an :class:`~bidict.OnDup` instance.
Use it like this: ``bi.put(1, 2, OnDup(key=DROP_NEW))``.
Or better yet, pass one of the
``ON_DUP_*`` convenience instances
instead if possible.
See the updated :ref:`basic-usage:Values Must Be Unique` docs for more info.
* Deprecate the
``on_dup_key``, ``on_dup_val``, and ``on_dup_kv``
bidict class attributes.
A :class:`UserWarning` will now be emitted if these are used.
They have been subsumed by the new
:attr:`~bidict.bidict.on_dup` class attribute,
which takes an :class:`~bidict.OnDup` instance.
See the updated :doc:`extending` docs for example usage.
* Move
:meth:`bidict.BidictBase.values` to
:meth:`bidict.BidirectionalMapping.values`,
since the implementation is generic.
* No longer use ``__all__`` in ``bidict/__init__.py``.
* Cap max_size rather than disabling health checks and deadline as a
less heavyhanded way to improve hypothesis test reliability on Travis.
2020-01-07 22:20:20 +00:00
|
|
|
|
- ``BidictBase._fwd_class`` → ``.fwd_cls``
|
|
|
|
|
- ``BidictBase._inv_class`` → ``.inv_cls``
|
|
|
|
|
- ``BidictBase._on_dup_key`` → ``on_dup_key``
|
|
|
|
|
- ``BidictBase._on_dup_val`` → ``on_dup_val``
|
|
|
|
|
- ``BidictBase._on_dup_kv`` → ``on_dup_kv``
|
2017-03-15 20:50:22 +00:00
|
|
|
|
|
2017-03-15 20:43:23 +00:00
|
|
|
|
|
|
|
|
|
0.13.1 (2017-03-15)
|
|
|
|
|
-------------------
|
2017-01-19 05:26:21 +00:00
|
|
|
|
|
2017-03-15 19:45:40 +00:00
|
|
|
|
- Fix regression introduced by the new
|
2018-01-02 21:49:34 +00:00
|
|
|
|
:meth:`~bidict.BidirectionalMapping.__subclasshook__`
|
2017-03-15 19:45:40 +00:00
|
|
|
|
functionality in 0.13.0 so that
|
|
|
|
|
``issubclass(OldStyleClass, BidirectionalMapping)`` once again
|
|
|
|
|
works with old-style classes,
|
|
|
|
|
returning ``False`` rather than raising :class:`AttributeError`
|
2019-09-03 14:54:11 +00:00
|
|
|
|
`#41 <https://github.com/jab/bidict/pull/41>`__
|
2017-03-15 19:45:40 +00:00
|
|
|
|
|
2017-01-19 05:26:21 +00:00
|
|
|
|
|
2017-01-19 05:08:38 +00:00
|
|
|
|
0.13.0 (2017-01-19)
|
|
|
|
|
-------------------
|
squashed changes for 0.13.0
- support Python 3.6, refactor CI/test setup, increase test coverage
- refactor BidirectionalMapping, BidictBase, OrderedBidictBase,
FrozenBidictBase, and subclasses
- move frozenorderedbidict into _frozen and looseorderedbidict into _loose
- register bidict as a virtual subclass of MutableMapping rather than
inheriting from it directly. This makes it clearer that it does not use any
of the concrete generic methods that MutableMapping provides.
- improve performance and flexibility of frozenbidict and
frozenorderedbidict hashing
- docs, including new type-hierarchy.png diagram
- rm unused imap, ifilter, izip_longest from compat, add PYPY
- update to latest versions of dependencies
- restore benchmarking on travis
2017-01-09 15:37:31 +00:00
|
|
|
|
|
|
|
|
|
- Support Python 3.6.
|
|
|
|
|
|
|
|
|
|
(Earlier versions of bidict should work fine on 3.6, but it is officially
|
|
|
|
|
supported starting in this version.)
|
|
|
|
|
|
2018-01-02 21:49:34 +00:00
|
|
|
|
- :class:`~bidict.BidirectionalMapping`
|
squashed changes for 0.13.0
- support Python 3.6, refactor CI/test setup, increase test coverage
- refactor BidirectionalMapping, BidictBase, OrderedBidictBase,
FrozenBidictBase, and subclasses
- move frozenorderedbidict into _frozen and looseorderedbidict into _loose
- register bidict as a virtual subclass of MutableMapping rather than
inheriting from it directly. This makes it clearer that it does not use any
of the concrete generic methods that MutableMapping provides.
- improve performance and flexibility of frozenbidict and
frozenorderedbidict hashing
- docs, including new type-hierarchy.png diagram
- rm unused imap, ifilter, izip_longest from compat, add PYPY
- update to latest versions of dependencies
- restore benchmarking on travis
2017-01-09 15:37:31 +00:00
|
|
|
|
has been refactored into an abstract base class,
|
|
|
|
|
following the way :class:`collections.abc.Mapping` works.
|
|
|
|
|
The concrete method implementations it used to provide have been moved
|
2017-11-20 03:24:08 +00:00
|
|
|
|
into a new ``BidictBase`` subclass.
|
squashed changes for 0.13.0
- support Python 3.6, refactor CI/test setup, increase test coverage
- refactor BidirectionalMapping, BidictBase, OrderedBidictBase,
FrozenBidictBase, and subclasses
- move frozenorderedbidict into _frozen and looseorderedbidict into _loose
- register bidict as a virtual subclass of MutableMapping rather than
inheriting from it directly. This makes it clearer that it does not use any
of the concrete generic methods that MutableMapping provides.
- improve performance and flexibility of frozenbidict and
frozenorderedbidict hashing
- docs, including new type-hierarchy.png diagram
- rm unused imap, ifilter, izip_longest from compat, add PYPY
- update to latest versions of dependencies
- restore benchmarking on travis
2017-01-09 15:37:31 +00:00
|
|
|
|
|
2018-01-02 21:49:34 +00:00
|
|
|
|
:class:`~bidict.BidirectionalMapping`
|
squashed changes for 0.13.0
- support Python 3.6, refactor CI/test setup, increase test coverage
- refactor BidirectionalMapping, BidictBase, OrderedBidictBase,
FrozenBidictBase, and subclasses
- move frozenorderedbidict into _frozen and looseorderedbidict into _loose
- register bidict as a virtual subclass of MutableMapping rather than
inheriting from it directly. This makes it clearer that it does not use any
of the concrete generic methods that MutableMapping provides.
- improve performance and flexibility of frozenbidict and
frozenorderedbidict hashing
- docs, including new type-hierarchy.png diagram
- rm unused imap, ifilter, izip_longest from compat, add PYPY
- update to latest versions of dependencies
- restore benchmarking on travis
2017-01-09 15:37:31 +00:00
|
|
|
|
now also implements
|
2018-01-02 21:49:34 +00:00
|
|
|
|
:meth:`~bidict.BidirectionalMapping.__subclasshook__`,
|
squashed changes for 0.13.0
- support Python 3.6, refactor CI/test setup, increase test coverage
- refactor BidirectionalMapping, BidictBase, OrderedBidictBase,
FrozenBidictBase, and subclasses
- move frozenorderedbidict into _frozen and looseorderedbidict into _loose
- register bidict as a virtual subclass of MutableMapping rather than
inheriting from it directly. This makes it clearer that it does not use any
of the concrete generic methods that MutableMapping provides.
- improve performance and flexibility of frozenbidict and
frozenorderedbidict hashing
- docs, including new type-hierarchy.png diagram
- rm unused imap, ifilter, izip_longest from compat, add PYPY
- update to latest versions of dependencies
- restore benchmarking on travis
2017-01-09 15:37:31 +00:00
|
|
|
|
so any class that provides a conforming set of attributes
|
2018-01-02 21:49:34 +00:00
|
|
|
|
(enumerated in :attr:`~bidict.BidirectionalMapping._subclsattrs`)
|
squashed changes for 0.13.0
- support Python 3.6, refactor CI/test setup, increase test coverage
- refactor BidirectionalMapping, BidictBase, OrderedBidictBase,
FrozenBidictBase, and subclasses
- move frozenorderedbidict into _frozen and looseorderedbidict into _loose
- register bidict as a virtual subclass of MutableMapping rather than
inheriting from it directly. This makes it clearer that it does not use any
of the concrete generic methods that MutableMapping provides.
- improve performance and flexibility of frozenbidict and
frozenorderedbidict hashing
- docs, including new type-hierarchy.png diagram
- rm unused imap, ifilter, izip_longest from compat, add PYPY
- update to latest versions of dependencies
- restore benchmarking on travis
2017-01-09 15:37:31 +00:00
|
|
|
|
will be considered a
|
2018-01-02 21:49:34 +00:00
|
|
|
|
:class:`~bidict.BidirectionalMapping`
|
squashed changes for 0.13.0
- support Python 3.6, refactor CI/test setup, increase test coverage
- refactor BidirectionalMapping, BidictBase, OrderedBidictBase,
FrozenBidictBase, and subclasses
- move frozenorderedbidict into _frozen and looseorderedbidict into _loose
- register bidict as a virtual subclass of MutableMapping rather than
inheriting from it directly. This makes it clearer that it does not use any
of the concrete generic methods that MutableMapping provides.
- improve performance and flexibility of frozenbidict and
frozenorderedbidict hashing
- docs, including new type-hierarchy.png diagram
- rm unused imap, ifilter, izip_longest from compat, add PYPY
- update to latest versions of dependencies
- restore benchmarking on travis
2017-01-09 15:37:31 +00:00
|
|
|
|
subclass automatically.
|
|
|
|
|
|
2017-11-20 03:24:08 +00:00
|
|
|
|
- ``OrderedBidirectionalMapping`` has been renamed to ``OrderedBidictBase``,
|
|
|
|
|
to better reflect its function. (It is not an ABC.)
|
squashed changes for 0.13.0
- support Python 3.6, refactor CI/test setup, increase test coverage
- refactor BidirectionalMapping, BidictBase, OrderedBidictBase,
FrozenBidictBase, and subclasses
- move frozenorderedbidict into _frozen and looseorderedbidict into _loose
- register bidict as a virtual subclass of MutableMapping rather than
inheriting from it directly. This makes it clearer that it does not use any
of the concrete generic methods that MutableMapping provides.
- improve performance and flexibility of frozenbidict and
frozenorderedbidict hashing
- docs, including new type-hierarchy.png diagram
- rm unused imap, ifilter, izip_longest from compat, add PYPY
- update to latest versions of dependencies
- restore benchmarking on travis
2017-01-09 15:37:31 +00:00
|
|
|
|
|
2017-11-18 03:35:40 +00:00
|
|
|
|
- A new ``FrozenBidictBase`` class has been factored out of
|
2018-01-02 21:49:34 +00:00
|
|
|
|
:class:`~bidict.frozenbidict` and
|
2017-11-16 20:44:51 +00:00
|
|
|
|
:class:`frozenorderedbidict <bidict.FrozenOrderedBidict>`.
|
squashed changes for 0.13.0
- support Python 3.6, refactor CI/test setup, increase test coverage
- refactor BidirectionalMapping, BidictBase, OrderedBidictBase,
FrozenBidictBase, and subclasses
- move frozenorderedbidict into _frozen and looseorderedbidict into _loose
- register bidict as a virtual subclass of MutableMapping rather than
inheriting from it directly. This makes it clearer that it does not use any
of the concrete generic methods that MutableMapping provides.
- improve performance and flexibility of frozenbidict and
frozenorderedbidict hashing
- docs, including new type-hierarchy.png diagram
- rm unused imap, ifilter, izip_longest from compat, add PYPY
- update to latest versions of dependencies
- restore benchmarking on travis
2017-01-09 15:37:31 +00:00
|
|
|
|
This implements common behavior such as caching the result of
|
2017-11-18 03:35:40 +00:00
|
|
|
|
``__hash__`` after the first call.
|
squashed changes for 0.13.0
- support Python 3.6, refactor CI/test setup, increase test coverage
- refactor BidirectionalMapping, BidictBase, OrderedBidictBase,
FrozenBidictBase, and subclasses
- move frozenorderedbidict into _frozen and looseorderedbidict into _loose
- register bidict as a virtual subclass of MutableMapping rather than
inheriting from it directly. This makes it clearer that it does not use any
of the concrete generic methods that MutableMapping provides.
- improve performance and flexibility of frozenbidict and
frozenorderedbidict hashing
- docs, including new type-hierarchy.png diagram
- rm unused imap, ifilter, izip_longest from compat, add PYPY
- update to latest versions of dependencies
- restore benchmarking on travis
2017-01-09 15:37:31 +00:00
|
|
|
|
|
|
|
|
|
- The hash implementations of
|
2018-01-02 21:49:34 +00:00
|
|
|
|
:class:`~bidict.frozenbidict` and
|
2017-11-16 20:44:51 +00:00
|
|
|
|
:class:`frozenorderedbidict <bidict.FrozenOrderedBidict>`.
|
2017-11-21 03:27:26 +00:00
|
|
|
|
have been reworked to improve performance and flexibility.
|
2017-11-29 01:36:39 +00:00
|
|
|
|
:class:`frozenorderedbidict <bidict.FrozenOrderedBidict>`\’s
|
2017-11-21 03:27:26 +00:00
|
|
|
|
hash implementation is now order-sensitive.
|
squashed changes for 0.13.0
- support Python 3.6, refactor CI/test setup, increase test coverage
- refactor BidirectionalMapping, BidictBase, OrderedBidictBase,
FrozenBidictBase, and subclasses
- move frozenorderedbidict into _frozen and looseorderedbidict into _loose
- register bidict as a virtual subclass of MutableMapping rather than
inheriting from it directly. This makes it clearer that it does not use any
of the concrete generic methods that MutableMapping provides.
- improve performance and flexibility of frozenbidict and
frozenorderedbidict hashing
- docs, including new type-hierarchy.png diagram
- rm unused imap, ifilter, izip_longest from compat, add PYPY
- update to latest versions of dependencies
- restore benchmarking on travis
2017-01-09 15:37:31 +00:00
|
|
|
|
|
|
|
|
|
See
|
2018-01-02 21:49:34 +00:00
|
|
|
|
``frozenbidict._compute_hash()`` and
|
2017-11-18 03:35:40 +00:00
|
|
|
|
``frozenorderedbidict._compute_hash``
|
squashed changes for 0.13.0
- support Python 3.6, refactor CI/test setup, increase test coverage
- refactor BidirectionalMapping, BidictBase, OrderedBidictBase,
FrozenBidictBase, and subclasses
- move frozenorderedbidict into _frozen and looseorderedbidict into _loose
- register bidict as a virtual subclass of MutableMapping rather than
inheriting from it directly. This makes it clearer that it does not use any
of the concrete generic methods that MutableMapping provides.
- improve performance and flexibility of frozenbidict and
frozenorderedbidict hashing
- docs, including new type-hierarchy.png diagram
- rm unused imap, ifilter, izip_longest from compat, add PYPY
- update to latest versions of dependencies
- restore benchmarking on travis
2017-01-09 15:37:31 +00:00
|
|
|
|
for more documentation of the changes,
|
|
|
|
|
including the new
|
2017-11-18 03:35:40 +00:00
|
|
|
|
``frozenbidict._USE_ITEMSVIEW_HASH`` and
|
|
|
|
|
``frozenorderedbidict._HASH_NITEMS_MAX``
|
squashed changes for 0.13.0
- support Python 3.6, refactor CI/test setup, increase test coverage
- refactor BidirectionalMapping, BidictBase, OrderedBidictBase,
FrozenBidictBase, and subclasses
- move frozenorderedbidict into _frozen and looseorderedbidict into _loose
- register bidict as a virtual subclass of MutableMapping rather than
inheriting from it directly. This makes it clearer that it does not use any
of the concrete generic methods that MutableMapping provides.
- improve performance and flexibility of frozenbidict and
frozenorderedbidict hashing
- docs, including new type-hierarchy.png diagram
- rm unused imap, ifilter, izip_longest from compat, add PYPY
- update to latest versions of dependencies
- restore benchmarking on travis
2017-01-09 15:37:31 +00:00
|
|
|
|
attributes.
|
|
|
|
|
If you have an interesting use case that requires overriding these,
|
|
|
|
|
or suggestions for an alternative implementation,
|
2018-04-06 04:28:44 +00:00
|
|
|
|
please `share your feedback <https://gitter.im/jab/bidict>`__.
|
squashed changes for 0.13.0
- support Python 3.6, refactor CI/test setup, increase test coverage
- refactor BidirectionalMapping, BidictBase, OrderedBidictBase,
FrozenBidictBase, and subclasses
- move frozenorderedbidict into _frozen and looseorderedbidict into _loose
- register bidict as a virtual subclass of MutableMapping rather than
inheriting from it directly. This makes it clearer that it does not use any
of the concrete generic methods that MutableMapping provides.
- improve performance and flexibility of frozenbidict and
frozenorderedbidict hashing
- docs, including new type-hierarchy.png diagram
- rm unused imap, ifilter, izip_longest from compat, add PYPY
- update to latest versions of dependencies
- restore benchmarking on travis
2017-01-09 15:37:31 +00:00
|
|
|
|
|
2018-02-26 23:29:56 +00:00
|
|
|
|
- Add ``_fwd_class`` and ``_inv_class`` attributes
|
2018-01-02 21:49:34 +00:00
|
|
|
|
representing the backing :class:`~collections.abc.Mapping` types
|
squashed changes for 0.13.0
- support Python 3.6, refactor CI/test setup, increase test coverage
- refactor BidirectionalMapping, BidictBase, OrderedBidictBase,
FrozenBidictBase, and subclasses
- move frozenorderedbidict into _frozen and looseorderedbidict into _loose
- register bidict as a virtual subclass of MutableMapping rather than
inheriting from it directly. This makes it clearer that it does not use any
of the concrete generic methods that MutableMapping provides.
- improve performance and flexibility of frozenbidict and
frozenorderedbidict hashing
- docs, including new type-hierarchy.png diagram
- rm unused imap, ifilter, izip_longest from compat, add PYPY
- update to latest versions of dependencies
- restore benchmarking on travis
2017-01-09 15:37:31 +00:00
|
|
|
|
used internally to store the forward and inverse dictionaries, respectively.
|
|
|
|
|
|
|
|
|
|
This allows creating custom bidict types with extended functionality
|
|
|
|
|
simply by overriding these attributes in a subclass.
|
|
|
|
|
|
2018-04-06 04:28:44 +00:00
|
|
|
|
See the new :doc:`extending` documentation for examples.
|
squashed changes for 0.13.0
- support Python 3.6, refactor CI/test setup, increase test coverage
- refactor BidirectionalMapping, BidictBase, OrderedBidictBase,
FrozenBidictBase, and subclasses
- move frozenorderedbidict into _frozen and looseorderedbidict into _loose
- register bidict as a virtual subclass of MutableMapping rather than
inheriting from it directly. This makes it clearer that it does not use any
of the concrete generic methods that MutableMapping provides.
- improve performance and flexibility of frozenbidict and
frozenorderedbidict hashing
- docs, including new type-hierarchy.png diagram
- rm unused imap, ifilter, izip_longest from compat, add PYPY
- update to latest versions of dependencies
- restore benchmarking on travis
2017-01-09 15:37:31 +00:00
|
|
|
|
|
2018-01-02 21:49:34 +00:00
|
|
|
|
- Pass any parameters passed to :meth:`~bidict.bidict.popitem`
|
squashed changes for 0.13.0
- support Python 3.6, refactor CI/test setup, increase test coverage
- refactor BidirectionalMapping, BidictBase, OrderedBidictBase,
FrozenBidictBase, and subclasses
- move frozenorderedbidict into _frozen and looseorderedbidict into _loose
- register bidict as a virtual subclass of MutableMapping rather than
inheriting from it directly. This makes it clearer that it does not use any
of the concrete generic methods that MutableMapping provides.
- improve performance and flexibility of frozenbidict and
frozenorderedbidict hashing
- docs, including new type-hierarchy.png diagram
- rm unused imap, ifilter, izip_longest from compat, add PYPY
- update to latest versions of dependencies
- restore benchmarking on travis
2017-01-09 15:37:31 +00:00
|
|
|
|
through to ``_fwd.popitem`` for greater extensibility.
|
|
|
|
|
|
|
|
|
|
- More concise repr strings for empty bidicts.
|
|
|
|
|
|
|
|
|
|
e.g. ``bidict()`` rather than ``bidict({})`` and
|
|
|
|
|
``orderedbidict()`` rather than ``orderedbidict([])``.
|
|
|
|
|
|
2020-07-30 13:31:03 +00:00
|
|
|
|
- Add ``bidict.compat.PYPY`` and
|
squashed changes for 0.13.0
- support Python 3.6, refactor CI/test setup, increase test coverage
- refactor BidirectionalMapping, BidictBase, OrderedBidictBase,
FrozenBidictBase, and subclasses
- move frozenorderedbidict into _frozen and looseorderedbidict into _loose
- register bidict as a virtual subclass of MutableMapping rather than
inheriting from it directly. This makes it clearer that it does not use any
of the concrete generic methods that MutableMapping provides.
- improve performance and flexibility of frozenbidict and
frozenorderedbidict hashing
- docs, including new type-hierarchy.png diagram
- rm unused imap, ifilter, izip_longest from compat, add PYPY
- update to latest versions of dependencies
- restore benchmarking on travis
2017-01-09 15:37:31 +00:00
|
|
|
|
remove unused ``bidict.compat.izip_longest``.
|
|
|
|
|
|
2016-07-04 03:29:24 +00:00
|
|
|
|
0.12.0 (2016-07-03)
|
|
|
|
|
-------------------
|
|
|
|
|
|
|
|
|
|
- New/renamed exceptions:
|
|
|
|
|
|
2018-01-02 21:49:34 +00:00
|
|
|
|
- :class:`~bidict.KeyDuplicationError`
|
|
|
|
|
- :class:`~bidict.ValueDuplicationError`
|
|
|
|
|
- :class:`~bidict.KeyAndValueDuplicationError`
|
|
|
|
|
- :class:`~bidict.DuplicationError` (base class for the above)
|
2016-06-28 04:05:22 +00:00
|
|
|
|
|
2018-01-02 21:49:34 +00:00
|
|
|
|
- :func:`~bidict.bidict.put`
|
2016-06-28 04:05:22 +00:00
|
|
|
|
now accepts ``on_dup_key``, ``on_dup_val``, and ``on_dup_kv`` keyword args
|
2017-11-20 03:24:08 +00:00
|
|
|
|
which allow you to override the default policy
|
2016-07-04 03:29:24 +00:00
|
|
|
|
when the key or value of a given item
|
2017-11-20 03:24:08 +00:00
|
|
|
|
duplicates any existing item's.
|
2016-06-28 04:05:22 +00:00
|
|
|
|
These can take the following values:
|
|
|
|
|
|
2018-02-20 10:23:04 +00:00
|
|
|
|
- :attr:`~bidict.RAISE`
|
Various API changes and other improvements.
* Deprecate ``bidict.OVERWRITE`` and ``bidict.IGNORE``.
A :class:`UserWarning` will now be emitted if these are used.
:attr:`bidict.DROP_OLD` and :attr:`bidict.DROP_NEW` should be used instead.
* Rename ``DuplicationPolicy`` to :class:`~bidict.OnDupAction`
(and implement it via an :class:`~enum.Enum`).
A :class:`~bidict.OnDupAction` may be one of
:attr:`~bidict.RAISE`,
:attr:`~bidict.DROP_OLD`, or
:attr:`~bidict.DROP_NEW`.
* Expose the new :class:`~bidict.OnDup` class,
a named (*key*, *val*, *kv*) tuple of :class:`~bidict.OnDupAction`\s
that should be taken upon encountering
the 3 kinds of duplication that can occur.
* Provide the
:attr:`~bidict.ON_DUP_DEFAULT`,
:attr:`~bidict.ON_DUP_RAISE`, and
:attr:`~bidict.ON_DUP_DROP_OLD`
:class:`~bidict.OnDup` convenience instances.
* Deprecate the
``on_dup_key``, ``on_dup_val``, and ``on_dup_kv`` arguments
of :meth:`~bidict.bidict.put` and :meth:`~bidict.bidict.putall`.
A :class:`UserWarning` will now be emitted if these are used.
They have been subsumed by the new *on_dup* argument,
which takes an :class:`~bidict.OnDup` instance.
Use it like this: ``bi.put(1, 2, OnDup(key=DROP_NEW))``.
Or better yet, pass one of the
``ON_DUP_*`` convenience instances
instead if possible.
See the updated :ref:`basic-usage:Values Must Be Unique` docs for more info.
* Deprecate the
``on_dup_key``, ``on_dup_val``, and ``on_dup_kv``
bidict class attributes.
A :class:`UserWarning` will now be emitted if these are used.
They have been subsumed by the new
:attr:`~bidict.bidict.on_dup` class attribute,
which takes an :class:`~bidict.OnDup` instance.
See the updated :doc:`extending` docs for example usage.
* Move
:meth:`bidict.BidictBase.values` to
:meth:`bidict.BidirectionalMapping.values`,
since the implementation is generic.
* No longer use ``__all__`` in ``bidict/__init__.py``.
* Cap max_size rather than disabling health checks and deadline as a
less heavyhanded way to improve hypothesis test reliability on Travis.
2020-01-07 22:20:20 +00:00
|
|
|
|
- ``OVERWRITE``
|
|
|
|
|
- ``IGNORE``
|
2016-06-28 04:05:22 +00:00
|
|
|
|
|
2017-11-20 03:24:08 +00:00
|
|
|
|
``on_dup_kv`` can also take ``ON_DUP_VAL``.
|
2016-06-28 04:05:22 +00:00
|
|
|
|
|
|
|
|
|
If not provided,
|
2018-01-02 21:49:34 +00:00
|
|
|
|
:func:`~bidict.bidict.put` uses the
|
2018-02-20 10:23:04 +00:00
|
|
|
|
:attr:`~bidict.RAISE` policy by default.
|
2016-06-28 04:05:22 +00:00
|
|
|
|
|
2018-01-02 21:49:34 +00:00
|
|
|
|
- New :func:`~bidict.bidict.putall` method
|
|
|
|
|
provides a bulk :func:`~bidict.bidict.put` API,
|
2017-11-20 03:24:08 +00:00
|
|
|
|
allowing you to override the default duplication handling policy
|
2018-01-02 21:49:34 +00:00
|
|
|
|
that :func:`~bidict.bidict.update` uses.
|
2016-06-28 04:05:22 +00:00
|
|
|
|
|
2018-01-02 21:49:34 +00:00
|
|
|
|
- :func:`~bidict.bidict.update` now fails clean,
|
|
|
|
|
so if an :func:`~bidict.bidict.update` call raises a
|
|
|
|
|
:class:`~bidict.DuplicationError`,
|
2016-07-04 03:29:24 +00:00
|
|
|
|
you can now be sure that none of the given items was inserted.
|
2016-06-28 04:05:22 +00:00
|
|
|
|
|
2016-07-04 03:29:24 +00:00
|
|
|
|
Previously, all of the given items that were processed
|
2016-06-28 04:05:22 +00:00
|
|
|
|
before the one causing the failure would have been inserted,
|
2016-07-04 03:29:24 +00:00
|
|
|
|
and no facility was provided to recover
|
|
|
|
|
which items were inserted and which weren't,
|
|
|
|
|
nor to revert any changes made by the failed
|
2018-01-02 21:49:34 +00:00
|
|
|
|
:func:`~bidict.bidict.update` call.
|
2016-06-28 04:05:22 +00:00
|
|
|
|
The new behavior makes it easier to reason about and control
|
2018-01-02 21:49:34 +00:00
|
|
|
|
the effects of failed :func:`~bidict.bidict.update` calls.
|
2016-06-28 04:05:22 +00:00
|
|
|
|
|
2018-01-02 21:49:34 +00:00
|
|
|
|
The new :func:`~bidict.bidict.putall` method also fails clean.
|
2016-06-28 04:05:22 +00:00
|
|
|
|
|
2016-07-04 03:29:24 +00:00
|
|
|
|
Internally, this is implemented by storing a log of changes
|
|
|
|
|
made while an update is being processed, and rolling back the changes
|
|
|
|
|
when one of them is found to cause an error.
|
2017-11-16 20:44:51 +00:00
|
|
|
|
This required reimplementing :class:`orderedbidict <bidict.OrderedBidict>`
|
2016-07-04 03:29:24 +00:00
|
|
|
|
on top of two dicts and a linked list, rather than two OrderedDicts,
|
2018-01-02 21:49:34 +00:00
|
|
|
|
since :class:`~collections.OrderedDict` does not expose
|
|
|
|
|
its backing linked list.
|
2016-06-28 04:05:22 +00:00
|
|
|
|
|
2017-11-16 20:44:51 +00:00
|
|
|
|
- :func:`orderedbidict.move_to_end() <bidict.OrderedBidict.move_to_end>`
|
2016-07-04 03:29:24 +00:00
|
|
|
|
now works on Python < 3.2 as a result of the new
|
2017-11-16 20:44:51 +00:00
|
|
|
|
:class:`orderedbidict <bidict.OrderedBidict>` implementation.
|
2016-06-28 04:05:22 +00:00
|
|
|
|
|
|
|
|
|
- Add
|
|
|
|
|
|
2020-07-30 13:31:03 +00:00
|
|
|
|
- ``bidict.compat.viewkeys``
|
|
|
|
|
- ``bidict.compat.viewvalues``
|
|
|
|
|
- ``bidict.compat.iterkeys``
|
|
|
|
|
- ``bidict.compat.itervalues``
|
2018-03-01 11:40:53 +00:00
|
|
|
|
- ``bidict.compat.izip``
|
squashed changes for 0.13.0
- support Python 3.6, refactor CI/test setup, increase test coverage
- refactor BidirectionalMapping, BidictBase, OrderedBidictBase,
FrozenBidictBase, and subclasses
- move frozenorderedbidict into _frozen and looseorderedbidict into _loose
- register bidict as a virtual subclass of MutableMapping rather than
inheriting from it directly. This makes it clearer that it does not use any
of the concrete generic methods that MutableMapping provides.
- improve performance and flexibility of frozenbidict and
frozenorderedbidict hashing
- docs, including new type-hierarchy.png diagram
- rm unused imap, ifilter, izip_longest from compat, add PYPY
- update to latest versions of dependencies
- restore benchmarking on travis
2017-01-09 15:37:31 +00:00
|
|
|
|
- ``bidict.compat.izip_longest``
|
2016-06-28 04:05:22 +00:00
|
|
|
|
|
|
|
|
|
to complement the existing
|
2020-07-30 13:31:03 +00:00
|
|
|
|
``bidict.compat.iteritems`` and
|
|
|
|
|
``bidict.compat.viewitems``
|
2016-06-28 04:05:22 +00:00
|
|
|
|
compatibility helpers.
|
|
|
|
|
|
2016-07-04 03:29:24 +00:00
|
|
|
|
- More efficient implementations of
|
2018-04-06 04:28:44 +00:00
|
|
|
|
``bidict.pairs()``,
|
2018-03-01 03:18:39 +00:00
|
|
|
|
:func:`~bidict.inverted`, and
|
2018-02-26 23:29:56 +00:00
|
|
|
|
:func:`~bidict.BidictBase.copy`.
|
2016-06-28 04:05:22 +00:00
|
|
|
|
|
2018-02-26 23:29:56 +00:00
|
|
|
|
- Implement :func:`~bidict.BidictBase.__copy__`
|
2016-06-28 04:05:22 +00:00
|
|
|
|
for use with the :mod:`copy` module.
|
|
|
|
|
|
2019-09-03 14:54:11 +00:00
|
|
|
|
- Fix issue preventing a client class from inheriting from ``loosebidict``.
|
|
|
|
|
`#34 <https://github.com/jab/bidict/issues/34>`__
|
2016-06-28 04:05:22 +00:00
|
|
|
|
|
|
|
|
|
- Add benchmarking to tests.
|
|
|
|
|
|
|
|
|
|
- Drop official support for CPython 3.3.
|
|
|
|
|
(It may continue to work, but is no longer being tested.)
|
|
|
|
|
|
|
|
|
|
Breaking API Changes
|
2017-11-16 20:44:51 +00:00
|
|
|
|
++++++++++++++++++++
|
2016-06-28 04:05:22 +00:00
|
|
|
|
|
2018-02-19 13:07:14 +00:00
|
|
|
|
- Rename ``KeyExistsException`` → :class:`~bidict.KeyDuplicationError`
|
|
|
|
|
and ``ValueExistsException`` → :class:`~bidict.ValueDuplicationError`.
|
2016-07-04 03:29:24 +00:00
|
|
|
|
|
2017-11-16 20:44:51 +00:00
|
|
|
|
- When overwriting the key of an existing value in an :class:`orderedbidict <bidict.OrderedBidict>`,
|
2016-07-04 03:29:24 +00:00
|
|
|
|
the position of the existing item is now preserved,
|
|
|
|
|
overwriting the key of the existing item in place,
|
|
|
|
|
rather than moving the item to the end.
|
|
|
|
|
This now matches the behavior of overwriting the value of an existing key,
|
|
|
|
|
which has always preserved the position of the existing item.
|
|
|
|
|
(If inserting an item whose key duplicates that of one existing item
|
|
|
|
|
and whose value duplicates that of another,
|
|
|
|
|
the existing item whose value is duplicated is still dropped,
|
|
|
|
|
and the existing item whose key is duplicated
|
|
|
|
|
still gets its value overwritten in place, as before.)
|
|
|
|
|
|
2018-04-06 04:28:44 +00:00
|
|
|
|
For example:
|
|
|
|
|
|
|
|
|
|
.. code:: python
|
|
|
|
|
|
|
|
|
|
>>> from bidict import orderedbidict # doctest: +SKIP
|
|
|
|
|
>>> o = orderedbidict([(0, 1), (2, 3)]) # doctest: +SKIP
|
|
|
|
|
>>> o.forceput(4, 1) # doctest: +SKIP
|
|
|
|
|
|
|
|
|
|
previously would have resulted in:
|
2016-07-04 03:29:24 +00:00
|
|
|
|
|
2018-04-06 04:28:44 +00:00
|
|
|
|
.. code:: python
|
2016-07-04 03:29:24 +00:00
|
|
|
|
|
2018-04-06 04:28:44 +00:00
|
|
|
|
>>> o # doctest: +SKIP
|
|
|
|
|
orderedbidict([(2, 3), (4, 1)])
|
2016-07-04 03:29:24 +00:00
|
|
|
|
|
2018-04-06 04:28:44 +00:00
|
|
|
|
but now results in:
|
2016-07-04 03:29:24 +00:00
|
|
|
|
|
2018-04-06 04:28:44 +00:00
|
|
|
|
.. code:: python
|
2016-07-04 03:29:24 +00:00
|
|
|
|
|
2018-04-06 04:28:44 +00:00
|
|
|
|
>>> o # doctest: +SKIP
|
|
|
|
|
orderedbidict([(4, 1), (2, 3)])
|
2016-06-28 04:05:22 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
0.11.0 (2016-02-05)
|
|
|
|
|
-------------------
|
|
|
|
|
|
|
|
|
|
- Add
|
2017-11-16 20:44:51 +00:00
|
|
|
|
:class:`orderedbidict <bidict.OrderedBidict>`,
|
2017-11-20 03:24:08 +00:00
|
|
|
|
``looseorderedbidict``, and
|
2017-11-16 20:44:51 +00:00
|
|
|
|
:class:`frozenorderedbidict <bidict.FrozenOrderedBidict>`.
|
2016-06-28 04:05:22 +00:00
|
|
|
|
|
2018-01-02 21:49:34 +00:00
|
|
|
|
- Add :doc:`code-of-conduct`.
|
2016-06-28 04:05:22 +00:00
|
|
|
|
|
|
|
|
|
- Drop official support for pypy3.
|
|
|
|
|
(It still may work but is no longer being tested.
|
|
|
|
|
Support may be added back once pypy3 has made more progress.)
|
|
|
|
|
|
|
|
|
|
0.10.0.post1 (2015-12-23)
|
|
|
|
|
-------------------------
|
|
|
|
|
|
|
|
|
|
- Minor documentation fixes and improvements.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
0.10.0 (2015-12-23)
|
|
|
|
|
-------------------
|
|
|
|
|
|
|
|
|
|
- Remove several features in favor of keeping the API simpler
|
|
|
|
|
and the code more maintainable.
|
|
|
|
|
|
|
|
|
|
- In the interest of protecting data safety more proactively, by default
|
|
|
|
|
bidict now raises an error on attempting to insert a non-unique value,
|
|
|
|
|
rather than allowing its associated key to be silently overwritten.
|
2018-04-06 04:28:44 +00:00
|
|
|
|
See discussion in `#21 <https://github.com/jab/bidict/issues/21>`__.
|
2016-06-28 04:05:22 +00:00
|
|
|
|
|
2018-01-02 21:49:34 +00:00
|
|
|
|
- New :meth:`~bidict.bidict.forceupdate` method
|
|
|
|
|
provides a bulk :meth:`~bidict.bidict.forceput` operation.
|
2016-06-28 04:05:22 +00:00
|
|
|
|
|
|
|
|
|
- Fix bugs in
|
2018-01-02 21:49:34 +00:00
|
|
|
|
:attr:`~bidict.bidict.pop` and
|
|
|
|
|
:attr:`~bidict.bidict.setdefault`
|
2016-06-28 04:05:22 +00:00
|
|
|
|
which could leave a bidict in an inconsistent state.
|
|
|
|
|
|
|
|
|
|
Breaking API Changes
|
2017-11-16 20:44:51 +00:00
|
|
|
|
++++++++++++++++++++
|
2016-06-28 04:05:22 +00:00
|
|
|
|
|
|
|
|
|
- Remove ``bidict.__invert__``, and with it, support for the ``~b`` syntax.
|
2018-02-26 23:29:56 +00:00
|
|
|
|
Use :attr:`~bidict.BidictBase.inv` instead.
|
2018-04-06 04:28:44 +00:00
|
|
|
|
`#19 <https://github.com/jab/bidict/issues/19>`__
|
2016-06-28 04:05:22 +00:00
|
|
|
|
|
|
|
|
|
- Remove support for the slice syntax.
|
|
|
|
|
Use ``b.inv[val]`` rather than ``b[:val]``.
|
2018-04-06 04:28:44 +00:00
|
|
|
|
`#19 <https://github.com/jab/bidict/issues/19>`__
|
2016-06-28 04:05:22 +00:00
|
|
|
|
|
|
|
|
|
- Remove ``bidict.invert``.
|
2018-02-26 23:29:56 +00:00
|
|
|
|
Use :attr:`~bidict.BidictBase.inv`
|
2016-06-28 04:05:22 +00:00
|
|
|
|
rather than inverting a bidict in place.
|
2018-04-06 04:28:44 +00:00
|
|
|
|
`#20 <https://github.com/jab/bidict/issues/20>`__
|
2016-06-28 04:05:22 +00:00
|
|
|
|
|
|
|
|
|
- Raise ``ValueExistsException``
|
|
|
|
|
when attempting to insert a mapping with a non-unique key.
|
2018-04-06 04:28:44 +00:00
|
|
|
|
`#21 <https://github.com/jab/bidict/issues/21>`__
|
2016-06-28 04:05:22 +00:00
|
|
|
|
|
2018-02-19 13:07:14 +00:00
|
|
|
|
- Rename ``collapsingbidict`` → ``loosebidict``
|
2016-06-28 04:05:22 +00:00
|
|
|
|
now that it suppresses
|
|
|
|
|
``ValueExistsException``
|
|
|
|
|
rather than the less general ``CollapseException``.
|
2018-04-06 04:28:44 +00:00
|
|
|
|
`#21 <https://github.com/jab/bidict/issues/21>`__
|
2016-06-28 04:05:22 +00:00
|
|
|
|
|
|
|
|
|
- ``CollapseException`` has been subsumed by
|
|
|
|
|
``ValueExistsException``.
|
2018-04-06 04:28:44 +00:00
|
|
|
|
`#21 <https://github.com/jab/bidict/issues/21>`__
|
2016-06-28 04:05:22 +00:00
|
|
|
|
|
2018-01-02 21:49:34 +00:00
|
|
|
|
- :meth:`~bidict.bidict.put` now raises ``KeyExistsException``
|
2016-06-28 04:05:22 +00:00
|
|
|
|
when attempting to insert an already-existing
|
|
|
|
|
key, and ``ValueExistsException`` when
|
|
|
|
|
attempting to insert an already-existing value.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
0.9.0.post1 (2015-06-06)
|
|
|
|
|
------------------------
|
|
|
|
|
|
|
|
|
|
- Fix metadata missing in the 0.9.0rc0 release.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
0.9.0rc0 (2015-05-30)
|
|
|
|
|
---------------------
|
|
|
|
|
|
2017-11-20 03:24:08 +00:00
|
|
|
|
- Add this changelog,
|
2018-04-06 04:28:44 +00:00
|
|
|
|
`Contributors' Guide <https://github.com/jab/bidict/blob/master/CONTRIBUTING.rst>`__,
|
|
|
|
|
`Gitter chat room <https://gitter.im/jab/bidict>`__,
|
2016-06-28 04:05:22 +00:00
|
|
|
|
and other community-oriented improvements.
|
|
|
|
|
|
2019-09-03 14:54:11 +00:00
|
|
|
|
- Adopt Pytest.
|
2016-06-28 04:05:22 +00:00
|
|
|
|
|
2017-11-21 03:27:26 +00:00
|
|
|
|
- Add property-based tests via
|
2018-04-06 04:28:44 +00:00
|
|
|
|
`hypothesis <https://hypothesis.readthedocs.io>`__.
|
2016-06-28 04:05:22 +00:00
|
|
|
|
|
|
|
|
|
- Other code, tests, and docs improvements.
|
|
|
|
|
|
|
|
|
|
Breaking API Changes
|
2017-11-16 20:44:51 +00:00
|
|
|
|
++++++++++++++++++++
|
2016-06-28 04:05:22 +00:00
|
|
|
|
|
2018-04-06 04:28:44 +00:00
|
|
|
|
- Move ``bidict.iteritems()`` and ``bidict.viewitems()``
|
2020-07-30 13:31:03 +00:00
|
|
|
|
to new ``bidict.compat`` module.
|
2016-06-28 04:05:22 +00:00
|
|
|
|
|
|
|
|
|
- Move :class:`bidict.inverted`
|
2018-03-01 03:18:39 +00:00
|
|
|
|
to new ``bidict.util`` module
|
2016-06-28 04:05:22 +00:00
|
|
|
|
(still available from top-level :mod:`bidict` module as well).
|
|
|
|
|
|
2018-04-06 04:28:44 +00:00
|
|
|
|
- Move ``bidict.fancy_iteritems()`` → ``bidict.util.pairs()``
|
|
|
|
|
(also available from top level as ``bidict.pairs()``).
|
2016-06-28 04:05:22 +00:00
|
|
|
|
|
2018-04-06 04:28:44 +00:00
|
|
|
|
- Rename :func:`bidict.namedbidict`\'s ``bidict_type`` argument → ``base_type``.
|