Commit Graph

327 Commits

Author SHA1 Message Date
jab b73ba3c559 improve namedbidict docstring 2018-03-01 21:31:35 +11:00
jab 54d9a18aa9 try disabling spurious lgtm warning with same-line comment 2018-03-01 15:06:17 +11:00
jab 412357d5ee
Merge pull request #67 from jab/dev
improve BidirectionalMapping.__subclasshook__, .compat, .util->._util, docs, tests, lint
2018-03-01 14:42:02 +11:00
jab 629481ec15 improve BidirectionalMapping.__subclasshook__, .compat, .util->._util, docs, tests, lint
- Implement BidirectionalMapping.__subclasshook__ in terms of
  Mapping.__subclasshook__ to simplify and correct its implementation.
- Add new test_class_relationships.py tests.
- Import collections ABCs from .compat. Importing them directly from
  collections was deprecated and will stop working in Python 3.8.
  In Python 2 collections.abc does not exist.
- rename util.py -> _util.py
2018-03-01 14:18:39 +11:00
jab d97d1ac09f silence spurious lgtm.com warnings 2018-02-28 22:48:50 +11:00
jab 7761e86dc8 improve PY2 calculation 2018-02-28 22:43:38 +11:00
jab 45f18ccc92
Merge pull request #66 from jab/dev
refactor to restore base classes, port most tests to hypothesis, improvements to namedbidict validation, docs
2018-02-28 00:39:36 +11:00
jab bfb6ed2a3b finish refactoring, misc. bugfixes, improve docs + tests 2018-02-28 00:09:57 +11:00
jab 38eb5bb5ac split out _ordered.py from _orderedbase.py 2018-02-27 11:37:32 +11:00
jab 585f955a4a mv _ordered.py -> _orderedbase.py 2018-02-27 11:21:50 +11:00
jab 5779f1da5b split out _frozen.py and _frozenordered.py 2018-02-27 11:08:00 +11:00
jab 9390791d9b split out _bidict.py from _mut.py 2018-02-27 10:52:49 +11:00
jab e1e11967cd mv _bidict.py -> _mut.py 2018-02-27 10:47:32 +11:00
jab 12c950185e mv _frozen.py -> _base.py 2018-02-27 10:43:22 +11:00
jab 4234bf8ce3 split back out (Ordered)BidictBase classes, improve namedbidict validation, docs 2018-02-27 10:29:56 +11:00
jab 38340e1532
Merge pull request #65 from jab/dev
replace non-generative eq and hash tests with hypothesis tests
2018-02-26 15:11:24 +11:00
jab e243afedb9 replace non-generative eq and hash tests with hypothesis tests 2018-02-26 14:58:04 +11:00
jab bea9b95b38
Merge pull request #64 from jab/dev
improve hypothesis tests, use of setuptools_scm and linting
2018-02-26 10:50:44 +11:00
jab aa704b3d6e improve hypothesis tests, use of setuptools_scm and linting 2018-02-26 10:44:21 +11:00
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