Commit Graph

24 Commits

Author SHA1 Message Date
jab 1ecc50a32c improve __inverted__ logic, docs
- 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-01-09 12:08:58 -05:00
jab 958ca8570a use more concise :role:`~foo.bar` sphinx link syntax
+ other small docs improvements
2018-01-02 16:49:34 -05:00
jab fc89808af7 docs 2017-12-17 13:58:57 -05:00
jab fb32b56de1 Fix #24 + other improvements.
- Use weakrefs to refer to a bidict's inverse to no longer create a reference
  cycle. Fixes #24.
- Rename fwd_cls to fwdm_cls.
- Rename inv_cls to invm_cls.
- inv_cls now returns the inverse class of the bidict, not its invm mapping.
- Rename isinv to _isinv.
2017-12-07 12:57:01 -05:00
jab ea93911f93 numerous improvements
- Make initializing (or updating an empty bidict) from only another
  BidirectionalMapping more efficient (skip dup checking).

- Fix accidental ignoring of specified base_type when (un)pickling
  namedbidicts.

- Fix incorrect inversion of some_named_bidict.inv.[fwdname]_for
  and some_named_bidict.inv.[invname]_for

- Only warn when unsupported Python version is detected.

- More tests.
2017-12-06 14:22:32 -05:00
jab 79894c28ba prepare for 0.14.1 release 2017-11-28 21:27:36 -05:00
jab 821c6a814c fix TypeError on b.viewitems() 2017-11-28 20:56:50 -05:00
jab 57b7ec117f fix AttributeError on `hash(frozenbidict().inv)` due to missing _hash attr 2017-11-28 20:36:39 -05:00
jab 06144d0c0f prepare for v0.14.0 release 2017-11-20 23:49:14 -05:00
jab 51c75d2bb0 another round of refinements
- Make OrderedBidict.__eq__ always order-insensitive.
  Add OrderedBidict.equals_order_sensitive for order-sensitive comparison.
  Drop OrderedBidict.ordered_cls and bidict.compat.Reversible.

- Add test coverage for bidict.metadata.

- Use setuptools_scm for automatic version discovery from source control.
  Drop bidict/VERSION file and associated machinery.

- Ditch testing macOS on Travis, it's just too slow.
  Testing on Linux should suffice.

- Ditch using pyenv on Travis to save time and complexity.
  Travis now has a better set of Python versions available out-of-the-box.

- Add support for "python setup.py test" and use that on Travis.
2017-11-20 22:27:27 -05:00
jab 64ed7278d8
more API and code improvements
including:
- simplify type hierarchy, merging the frozen types into the base types
- upgrade to latest hypothesis (3.38.0)
- use Reversible for order-sensitive FrozenOrderedBidict.__eq__
- fix bug where bidict._on_dup_kv was not set to ON_DUP_VAL as documented
- drop leading underscore from attrs that should be public
- improve setup.py/metadata
- rename DuplicationBehavior -> DuplicationPolicy
- drop ON_DUP_VAL duplication policy in preference to just using None
- reduce ordered bidict memory usage and speed up copy
2017-11-19 22:24:08 -05:00
jab 22f4e78d09
numerous fixes and improvements (#43)
- .travis.yml and setup.py tweaks
- add regression tests for -O bug and document fix
- Make OrderedBidict equality comparison order-sensitive in more cases.
- Add bidict.BidictBase.ordered class attribute.
- Replacing OrderedBidictBase._should_compare_order_sensitive()
  with OrderedBidictBase.should_compare_order_sensitive_to().
- Revert the optimizations in v0.13.0 to make FrozenOrderedBidict instances
  that have the same items in different order have different hash values.
- Remove FrozenBidictBase.
- Remove frozenbidict._USE_ITEMSVIEW_HASH and
  frozenorderedbidict._HASH_NITEMS_MAX
2017-11-17 22:35:40 -05:00
jab 033083ca26
various code and CI improvements + dependency updates (#42) 2017-11-16 15:44:51 -05:00
jab 050e61e0f7 update to latest deps; tests + docs improvements 2017-10-11 10:26:22 -04:00
jab 72d639e44f document adding support for latest pypy3
[ci skip]
2017-06-12 11:55:03 -04:00
jab 2a47714a21 docs: factor out versioneye prompt from changelog and include in readme too 2017-03-31 14:58:44 -04:00
jab 5f4e0486e4 bump version to 0.13.2.dev0 post-release 2017-03-15 16:50:22 -04:00
jab 2c7c53d7b4 prepare for 0.13.1 release 2017-03-15 16:43:23 -04:00
jab 6f5dbd4d5b tweak @knaperek's improvements from #41 + thanks 2017-03-15 15:45:40 -04:00
jab 803fa3faf1 bump version to 0.13.1.dev0 post release 2017-01-19 00:26:21 -05:00
jab 4bfb6038ec prepare for 0.13.0 release 2017-01-19 00:08:38 -05:00
jab 887e078907 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 10:37:31 -05:00
jab b6a56d794b prepare for 0.12.0 release 2016-07-03 23:52:45 -04:00
jab 79228b78e3 squashed changes for 0.12.0 2016-06-28 00:05:23 -04:00