diff --git a/clvm/SExp.py b/clvm/SExp.py index 398fe108..44022ba1 100644 --- a/clvm/SExp.py +++ b/clvm/SExp.py @@ -117,6 +117,9 @@ def to_sexp_type( return stack[0] +_T_SExp = typing.TypeVar("_T_SExp") + + class SExp: """ SExp provides higher level API on top of any object implementing the CLVM @@ -173,7 +176,7 @@ def as_bin(self): return f.getvalue() @classmethod - def to(class_, v: CastableType) -> "SExp": + def to(class_: typing.Type[_T_SExp], v: CastableType) -> _T_SExp: if isinstance(v, class_): return v diff --git a/clvm/py.typed b/clvm/py.typed new file mode 100644 index 00000000..e69de29b diff --git a/setup.py b/setup.py index a1a86be7..568e3750 100755 --- a/setup.py +++ b/setup.py @@ -17,6 +17,9 @@ setup( name="clvm", packages=["clvm",], + package_data={ + "": ["py.typed"], + }, author="Chia Network, Inc.", author_email="hello@chia.net", url="https://github.com/Chia-Network/clvm",