From e3c907a4d213b8ba7a02ccea82547a8a9365f804 Mon Sep 17 00:00:00 2001 From: ken-morel Date: Sun, 9 Jun 2024 00:13:21 +0100 Subject: [PATCH] ;;; --- README.md | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index cee4ed4..a34fc7d 100644 --- a/README.md +++ b/README.md @@ -76,4 +76,28 @@ These are what pyoload adds to the standard annotations: > [!NOTE] > The added annotations are still not mergeable with the standard types. -### +### `pyoload.Values` + +A simple `tuple` subclass, use them as annotation and it will validate only +included values. + +### `pyoload.Cast` + +This performs recursive casting of the passed arguments into the specified type +It supports `dict` generic aliases as `dict[str, int | str] ` and tries cast in +the specified order when the type is a Union. + +### `pyoload.Checks` + +Permits You tou use custom checker methods, e.g + +```python +from pyoload import * + +test = lambda val: True # put your check here + +def foo(a: Checks(func=test): + ... +``` + +You can register your own checks or use some other builtin checks