Commit Graph

208 Commits

Author SHA1 Message Date
jab 853267d9f0 more docstring tweaks 2018-02-24 21:57:44 +11:00
jab 319b0dfa66 docs tweaks 2018-02-24 21:36:23 +11:00
jab 7a0367cba6
Merge pull request #61 from jab/dev
misc. improvements to docs and tests
2018-02-24 20:51:18 +11:00
jab 423f60e026 improve docs 2018-02-24 20:14:42 +11:00
jab 109ff32466 add tests for __slots__ 2018-02-24 16:35:44 +11:00
jab 77b97764fa use "lgtm [py/missing-equals]" to silence spurious warning 2018-02-24 13:36:56 +11:00
jab 5ad2df0da0
Merge pull request #60 from jab/dev
improve sorted bidict recipe docs + doctests
2018-02-20 22:54:30 +11:00
jab c79e4df888 improve sorted bidict recipe docs + doctests 2018-02-20 22:34:47 +11:00
jab 16f90fc480
Merge pull request #59 from jab/dev
numerous code improvements
2018-02-20 21:40:00 +11:00
jab 456f247b1d numerous code improvements
- Refactor _dedup_item, _write_item, and _undo_write methods to use
  higher-level abstractions (_DedupResult and _WriteResult classes).
- Add internal _OnDup class to bundle (on_dup_key, on_dup_val, on_dup_kv)
  together into a single abstraction. Signatures of methods like _put and
  _update are cleaner as a result.
- Add the "_NOOP" _DedupResult abstraction.
- Make _Marker extend namedtuple, no need for it to be mutable.
- Enable the pylint messages that were disabled now that the code is cleaner.
- Make DuplicationPolicy extend _Marker and make RAISE, OVERWRITE, and
  IGNORE instances of DuplicationPolicy once again. This time deprecate
  access via DuplicationPolicy.(IGNORE|RAISE|OVERWRITE) to prevent
  infinite chaining.
- Misc. code and docs improvements.
2018-02-20 21:23:04 +11:00
jab becf25a5b4
Merge pull request #58 from jab/dev
improve code comments and APIs (give APIs that should be private a leading _)
2018-02-20 00:43:06 +11:00
jab 02dcb49329 improve code comments and APIs (give APIs that should be private a leading _) 2018-02-20 00:07:14 +11:00
jab d57bae234f fix test 2018-02-19 20:16:09 +11:00
jab 5cc0af2623
Merge pull request #57 from jab/dev
improvements to namedbidict and tests
2018-02-19 19:14:11 +11:00
jab 459f9365cf improve test coverage 2018-02-19 18:53:03 +11:00
jab f1749540cb improve namedbidict
- raise TypeError if base_type is not a frozenbidict subclass
- rewrite the code to be clearer
2018-02-19 16:57:42 +11:00
jab 5a8ab033e8 test python 2.7 on appveyor instead of 3.5 2018-02-19 13:57:41 +11:00
jab 8e56f527a1
Merge pull request #56 from jab/dev
code and documentation improvements
2018-02-19 13:56:02 +11:00
jab 4d906b6eca code and documentation improvements
- Use __slots__ to speed up attribute access and decrease memory usage
  (adding _SlotPickleMixin to preserve pickleability)
- "Code review nav" comments
- Remove _clear from frozenbidict, leaving only the public `clear` methods on
  the mutable bidict types. Much clearer now! (ducks)
- Improve `pop` and `popitem` signatures. No need for them to take *args/**kw.
- Make bidict extend MutableMapping directly rather than registering it as a
  virtual subclass. Leave a comment explaining that it inherits
  MutableMapping's setdefault implementation now that it isn't added manually.
- Make the DuplicationPolicy class just a namespace holding
  RAISE, OVERWRITE, and IGNORE, not a _Marker itself.
  Make RAISE, OVERWRITE, and IGNORE just _Markers, not `DuplicationPolicy`s.
- Various other code and docs improvements.
2018-02-19 13:40:01 +11:00
jab 153ce361b3 tiny cosmetic docs tweaks 2018-02-13 23:13:24 +11:00
jab c09d9653f9
Merge pull request #55 from jab/dev
make __repr__ less clever, small __iter__ optimization, etc.
2018-02-13 12:51:05 +11:00
jab 24b3d9b7dc various improvements
- Make :func:`bidict.FrozenOrderedBidict.__iter__` slightly more efficient.

- :func:`~bidict.frozenbidict.__repr__` no longer dynamically checks
  for a ``__reversed__`` method to determine whether to use an ordered or
  unordered ``__repr__`` delegate. Now it always just calls the new
  :func:`~bidict.frozenbidict.__repr_delegate__` instead, which may be
  explicitly overridden as needed.
2018-02-13 12:34:33 +11:00
jab b046db134e include usage example in README 2018-02-13 10:51:08 +11:00
jab b6e5501ca5
Merge pull request #54 from jab/dev
allow failures on Travis for CPython 3.7-dev
2018-01-25 15:05:35 -05:00
jab d2ff19e01a allow failures on Travis for CPython 3.7-dev
Started segfaulting last night. Shouldn't mark the entire build.
2018-01-25 14:40:05 -05:00
jab 256270489a tweak inv-avoids-reference-cycles docs 2018-01-16 19:43:39 -05:00
jab 174e0050f5
Merge pull request #53 from jab/dev
small improvements
2018-01-15 22:14:18 -05:00
jab e3b749358c readme tweaks 2018-01-15 22:02:08 -05:00
jab 31acba17ff ditch no longer necessary URLs in linkcheck_ignore
GitHub now gives 302 (rather than 404) for .../fork when not logged in
2018-01-15 22:01:54 -05:00
jab 2c9a41570a alphabetize MANIFEST.in 2018-01-15 20:39:20 -05:00
jab ac632bd92d Merge branch 'patch-1' of https://github.com/synapticarbors/bidict into dev
* 'patch-1' of https://github.com/synapticarbors/bidict:
  Update MANIFEST.in to include license file
2018-01-15 20:38:40 -05:00
jab f0925e20ca tweak comment and whitespace in .travis.yml 2018-01-15 20:34:18 -05:00
Joshua Adelman 8885ac357f
Update MANIFEST.in to include license file 2018-01-15 16:11:01 -05:00
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 d1711fc71f silence spurious lgtm alert 2018-01-08 11:15:06 -05:00
jab 3187c67078 more learning docs 2018-01-03 15:46:20 -05:00
jab 6223d4d6f0 docs 2018-01-03 13:16:37 -05:00
jab 1a67961423 flesh out "learning from bidict" outline 2018-01-02 19:24:44 -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 b991f887c5 fix link to NotImplemented 2018-01-02 15:55:42 -05:00
jab 6f374c7d3c add "learning from bidict" docs 2018-01-02 15:32:06 -05:00
jab d0c6fdae3b happy 2018 2017-12-31 22:51:19 -05:00
jab 649f1e6f49 add tests for no reference cycles 2017-12-17 21:42:46 -05:00
jab fc89808af7 docs 2017-12-17 13:58:57 -05:00
jab 7fbc19090a appease latest pylint 2017-12-17 13:22:42 -05:00
jab 50a1042f68 rm outdated caveat about reference cycles 2017-12-07 17:01:36 -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 c7002bf2b2 unbreak logo image in long_description for PyPI 2017-12-06 14:56:35 -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