From 970525b4625ce707411abad2bfeb6219d5661592 Mon Sep 17 00:00:00 2001 From: curegit <37978051+curegit@users.noreply.github.com> Date: Tue, 9 May 2023 21:55:43 +0900 Subject: [PATCH] Add readme draft --- README.md | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..3e31eea --- /dev/null +++ b/README.md @@ -0,0 +1,46 @@ +# Reification + +## Requirements + +Python >= 3.11 + +Any non-builtin modules are NOT required. + +## Install + +## Usage + +```py +>>> from reification import reify +>>> a = reify[list[int]]([1, 2, 3]) +>>> a.type +list[int] +``` + +```py +T = TypeVar("T") + +class CheckedStack(Reific[T]): + +``` + +```py +>>> int_stack = CheckedStack[int]() +>>> isinstance(int_stack, CheckedStack[int]) +True +>>> isinstance(int_stack, CheckedStack[str]) +False +``` + +subclass works as you expected. + +```py +>>> issubclass(Reified[int], Reified[int]) +>>> issubclass(Reified, Reified[int]) +>>> issubclass(Reified[int], Reified) +>>> issubclass(Reified[str], Reified[int]) +``` + +## License + +[WTFPL](LICENSE)