Commit Graph

4 Commits

Author SHA1 Message Date
Matt Bullock 336d052ec9 Some new validators (#425)
* initial implementation of deep validators for iterables and dictionaries

* initial implementation of is_callable validator

* add versionadded for deep validators

* add versionadded for is_callable validator

* add tests for is_callable validator

* tweak _DeepIterable repr

* add tests for deep_iterable

* add to _DeepDictionary an initial validation that the top-level value is in fact a dictionary

* add tests for deep_dictionary validator

* apply precommit hooks

* refactor deep_dictionary to deep_mapping with optional mapping validator

* move is_callable validator up in module to allow deep validators to use it

* complete conversion from "deep dictionary" to "deep mapping"

* add changelog.d entry for #425

* fix rst formatting and normalize to semantic newlines

* add "instance_of", "deep_iterable", and "deep_mapping" validators to docs/api.rst

* add "serve-docs" tox environment to preview rendered sphinx docs

* bump versionadded for is_callable and deep validators to 18.3.0

* linting cleanup

* Revert "add "serve-docs" tox environment to preview rendered sphinx docs"

This reverts commit a2df89b788fdc31b54e604095c166b6a37c56f19.

* fix error message broken in linting fix
2018-11-07 19:33:52 -08:00
Hynek Schlawack aaeba93b06 Prepare 18.2.0 2018-09-01 06:44:34 +02:00
Hynek Schlawack 12682192ba Use consistently autodoc syntax for arguments 2018-08-27 14:43:22 +02:00
Ryan Gabbard 3e0ecbd891 Cache hash codes (#426)
* First stab at implementing hashcode caching (#423)

Currently all existing tests pass but no cache_hash tests have yet
been added.

* Existing hash tests now pass on cache_hash classes

* Add towncrier change log

* Add documentation for cache_hash

* Fixes bug with check that init=True if cache_hash=True

* Fix long lines

* Fix documentation issues

* Add test for cache_hash requiring init

* Improve test coverage

* Remove now unnecessary 'pass'

* Add periods to the end of exception strings

* Add test docstrings for cache_hash tests

* Clarify documentation of cache_hash

* Recommend that hashable classes be frozen

* Fix test references for exception messages
2018-08-20 06:46:52 +02:00