Bidict

Latest version: v0.23.1

Safety actively analyzes 629564 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 3 of 4

0.18.3

-------------------

- Improve validation of names passed to ``namedbidict``:
Use :meth:`str.isidentifier` on Python 3,
and a better regex on Python 2.

- On Python 3,
set :attr:`~definition.__qualname__` on ``namedbidict`` classes
based on the provided ``typename`` argument.

0.18.2

-------------------

- Warn that Python 2 support will be dropped in a future release
when Python 2 is detected.

0.18.1

-------------------

- 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.
:issue:`94`

0.18.0

-------------------

- Rename ``bidict.BidirectionalMapping.inv`` to :attr:`~bidict.BidirectionalMapping.inverse`
and make :attr:`bidict.BidictBase.inv` an alias for :attr:`~bidict.BidictBase.inverse`.
:issue:`86`

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

0.17.5

-------------------

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 ``_repr_delegate``.

0.17.4

-------------------

Minor code, interop, and (semi-)private API improvements.

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

- 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
``BidictBase.__delegate__`` attribute.
The ``BidictBase.__delegate__`` object
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.

- Change ``__repr_delegate__``
to simply take a type like :class:`dict` or :class:`list`.

- Upgrade to latest major
`sortedcontainers <https://github.com/grantjenks/python-sortedcontainers>`__
version (from v1 to v2)
for the :ref:`extending:\`\`SortedBidict\`\` Recipes`.

- ``bidict.compat.{view,iter}{keys,values,items}`` on Python 2
no longer assumes the target object implements these methods,
as they're not actually part of the
:class:`~collections.abc.Mapping` interface,
and provides fallback implementations when the methods are unavailable.
This allows the :ref:`extending:\`\`SortedBidict\`\` Recipes`
to continue to work with sortedcontainers v2 on Python 2.

Page 3 of 4

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.