Commit Graph

2 Commits

Author SHA1 Message Date
Davis Kirkendall 3d287594e0 Allow collections.abc.Callable to be used as type in python 3.9 (#2519)
* Allow collections.abc.Callable to be used as type in python 3.9

* Add is_none_type as function to check none types by identity

* Modify `typing.is_none_type` to work in python 3.6 and 3.7

* Add tests for none types in typing.py

* Apply review comments on #2519
* Add different implementations depending on python version
* Add tests for is_none_type

* Add change entry

* Fix field info repr

* Remove unneeded try/except for python < 3.8

* Add comment explaining alternative is_none_type implementation

* fix: typo

Co-authored-by: PrettyWood <em.jolibois@gmail.com>
2021-09-04 00:25:28 +02:00
Artem Malyshev 987449a922 Support typing.Callable validation. (#364)
fix #279

* Support typing.Callable validation.

* Add myself to HISTORY.

* Prove it works with just Callable.

* Document callable validator behavior.

* Support differences in typing module between py36 and py37.

* Remove callable filed from JSON schema with warning.

* Update pydantic/schema.py

Co-Authored-By: proofit404 <proofit404@gmail.com>

* Update tests/test_callable.py

Co-Authored-By: proofit404 <proofit404@gmail.com>

* Update pydantic/validators.py

Co-Authored-By: proofit404 <proofit404@gmail.com>

* Update tests/test_callable.py

Co-Authored-By: proofit404 <proofit404@gmail.com>

* Move callables to the exotic types.

* Move Callable type choice to the import time.

* Move is_callable_type to the utils module.

* Raise warning at skip except.

* Update pydantic/schema.py

Co-Authored-By: proofit404 <proofit404@gmail.com>

* Update docs/index.rst

Co-Authored-By: proofit404 <proofit404@gmail.com>

* Update pydantic/schema.py

Co-Authored-By: proofit404 <proofit404@gmail.com>

* uprev

* Update index.rst (#370)

* Update history.rst

* Make the example a little more concise.

* Use callable import from the utils.

* Remove blank line.

* Remove duplication comments.

* fix history
2019-01-29 15:42:00 +00:00