Files
pydantic/docs/examples
Stephan Lanfermann 1b467da11f Added generic approach to strict type checking for constrained types (#799)
* Added generic approach to strict type checking for constraint types
- Use the arbitrary validator to build strict validators for ConstrainedInt, ConstrainedFloat, ConstrainedStr
- Make StrictStr a derived class of ConstrainedStr
- Add tests for new strict cases for ConstrainedInt and ConstrainedFloat

* - Created StrictInt and StrictFloat subclasses and exported them
- Changed strictness tests to use these new subclasses

* - Added section for Strict Types to docs

* - Added changes file

* Update docs/index.rst

Co-Authored-By: Zaar Hai <haizaar@users.noreply.github.com>

* Update docs/index.rst

Co-Authored-By: Zaar Hai <haizaar@users.noreply.github.com>

* - Create validators for strict int and float
- Make ConstrainedInt and ConstrainedFloat use those validators instead of abusing arbitrary type validator for strictness
- Prevent double validaton of same conditions by only yielding either the strict or non-strict type validator for for those classes

* Changed strict int and float tests to alos match for exception message in invalid cases

* - Removed obvious note about lack of ConstrainedBool
- Added example for strict type usage
- Added note about caveats for StrictInt and StrictFloat

* Update pydantic/validators.py

faster method to check if a value is boolean for strict int validator

Co-Authored-By: Samuel Colvin <samcolvin@gmail.com>

* - Removed StrictBool part from Boolean section of docs
- Moved the Strctbool code example into strict_types.py example file

* - Changed behavior of strictness for COnstrainedStr to match that fo other constrained types

* - Actually make ConstrainedStr use the correct validator for strictness
2019-09-17 12:38:51 +01:00
..
2018-08-25 17:06:32 +01:00
2018-02-06 13:56:45 +00:00
2019-05-22 13:14:35 +01:00
2018-10-01 09:48:28 +01:00
2018-08-29 10:38:02 +01:00
2019-08-21 13:13:46 +01:00
2018-06-04 10:55:48 +01:00
2019-09-02 11:37:33 +01:00
2019-07-23 16:40:28 +01:00
2019-07-23 16:40:28 +01:00
2019-07-23 16:40:28 +01:00
2017-06-21 18:15:08 +01:00
2018-06-18 12:20:10 +01:00
2019-08-05 09:47:15 -05:00
2017-11-07 11:26:16 +00:00
2019-09-02 11:37:33 +01:00
2019-09-02 11:37:33 +01:00
2019-09-02 11:37:33 +01:00
2017-11-08 14:37:01 +00:00
2018-06-24 17:52:56 +01:00