All Versions
29
Latest Version
Avg Release Cycle
78 days
Latest Release
404 days ago

Changelog History
Page 1

  • v0.21.2 Changes

    September 07, 2020

    ๐Ÿš€ Please see https://bidict.readthedocs.io/en/v0.21.2/changelog.html for the changes in this release.

  • v0.21.1 Changes

    September 07, 2020

    ๐Ÿš€ This release was yanked and replaced with the 0.21.2 release, which actually provides the intended changes.

  • v0.21.0 Changes

    August 22, 2020
    • :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, e.g. missing higher-kinded types support (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.

  • v0.20.0 Changes

    July 23, 2020

    The following breaking changes are expected to affect few if any users.

    โœ‚ Remove APIs deprecated in the previous release:

    • bidict.OVERWRITE and bidict.IGNORE.

    • The on_dup_key, on_dup_val, and on_dup_kv arguments of :meth:~bidict.bidict.put and :meth:~bidict.bidict.putall.

    • The on_dup_key, on_dup_val, and on_dup_kv :class:~bidict.bidict class attributes.

    • 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>__

  • v0.19.0 Changes

    January 09, 2020
    • โฌ‡๏ธ Drop support for Python 2 :ref:as promised in v0.18.2 <changelog:0.18.2 (2019-09-08)>.

    The :mod:bidict.compat module has been pruned accordingly.

    This makes bidict more efficient on Python 3 and enables further improvement to bidict in the future.

    • ๐Ÿ—„ 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).

    An :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 to contain the three :class:~bidict.OnDupAction\s that should be taken upon encountering the three kinds of duplication that can occur (key, val, kv).

    • 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.

    These 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=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.

    The :ref:basic-usage:Values Must Be Unique docs have been updated accordingly.

    • ๐Ÿ—„ Deprecate the on_dup_key, on_dup_val, and on_dup_kv :class:~bidict.bidict class attributes. 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.

    • ๐Ÿ‘Œ Improve the more efficient implementations of :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__ by delegating to backing :class:dict\s in the bidict types for which this is possible.

    • ๐Ÿšš Move :meth:bidict.BidictBase.values to :meth:bidict.BidirectionalMapping.values, since the implementation is generic.

    • No longer use __all__ in :mod:bidict's __init__.py.

  • v0.18.4 Changes

    November 03, 2020

    ๐Ÿš€ Please see https://bidict.readthedocs.io/en/v0.18.4/changelog.html#id1 for the changes in this release.

  • v0.18.3 Changes

    September 22, 2019
    • ๐Ÿ‘Œ Improve validation of names passed to :func:~bidict.namedbidict: Use :meth:str.isidentifier on Python 3, and a better regex on Python 2.

    • On Python 3, set :attr:~definition.__qualname__ on :func:~bidict.namedbidict classes based on the provided typename argument.

  • v0.18.2 Changes

    September 08, 2019

    ๐Ÿš€ Please see https://bidict.readthedocs.io/en/v0.18.2/changelog.html for the changes in this release.

  • v0.18.1 Changes

    September 03, 2019
    • ๐Ÿ›  Fix a regression introduced by the memory optimizations added in 0.15.0 which caused :func:deepcopied <copy.deepcopy> and :func:unpickled <pickle.loads> bidicts to have their inverses set incorrectly. #94 <https://github.com/jab/bidict/issues/94>__
  • v0.18.0 Changes

    February 14, 2019
    • ๐Ÿ“‡ Rename bidict.BidirectionalMapping.inv to :attr:~bidict.BidirectionalMapping.inverse and make :attr:bidict.BidictBase.inv an alias for :attr:~bidict.BidictBase.inverse. #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.

    • โž• Add Python 2/3-compatible :attr:bidict.compat.collections_abc alias.

    • โœ… Stop testing Python 3.4 on CI, and warn when Python 3 < 3.5 is detected rather than Python 3 < 3.3.

    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>__.