Commit Graph

13 Commits

Author SHA1 Message Date
Joshua Bronson 0ad5284f75 Finish first pass at adding type hints.
Fixes #93.
2020-08-12 10:22:25 -04:00
Joshua Bronson 01460c86a3 reduce noisy pylint comments 2020-08-01 09:44:24 -04:00
Joshua Bronson e62d85d933 Begin adding type hints, drop Python 3.5, rm bidict.compat 2020-08-01 09:31:15 -04:00
Joshua Bronson 2efdc0e7b8 Upgrade dependencies for various extras, precommit hooks, CI
Use a single job that runs all precommit hooks in CI
rather than separate jobs for flake8, pylint, pydocstyle, etc.
2020-07-29 21:59:45 -04:00
jab 5f9cab9acf drop Py3.4 from Travis, update to latest flake8 + pydocstyle, improve lint_src spelling 2019-01-30 23:53:50 -05:00
jab 2aebc46d96 Decrease hypothesis max_examples for daily Travis cron builds
...and suppress the "too_slow" health check for cron and coverage-
enabled builds since it recently started to fail intermittently.
2018-09-09 17:54:56 -04:00
jab 20e1c18af1 update to latest pylint (2.0.0) and appease it 2018-07-16 20:26:36 -04:00
jab 163667d5b4 optimize implementations of keys, values, and items
- Also refactor and improve hypothesis tests.
- Add a test that ordered bidict nodes have no reference cycles.
- Enable coverage on Travis for PyPy 2 now that there is a code path
  that is only taken on PyPy 2 (for FrozenOrderedBidict.iteritems).
- Restore running tests on Travis for all commits, not just for master.
- Docs:
  - OrderedBidict: "What if my Python version has order-preserving dicts?"
  - Equivalent but distinct Hashables: better code example demonstrating
    that this even occurs with a bidict and its own inverse.
2018-04-25 21:34:27 +07:00
jab aa704b3d6e improve hypothesis tests, use of setuptools_scm and linting 2018-02-26 10:44:21 +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 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 7fbc19090a appease latest pylint 2017-12-17 13:22:42 -05:00
jab 033083ca26
various code and CI improvements + dependency updates (#42) 2017-11-16 15:44:51 -05:00