Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added py.typed to export hints for mypy, fixup hints #102

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion clvm/SExp.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down
Empty file added clvm/py.typed
Empty file.
3 changes: 3 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
setup(
name="clvm",
packages=["clvm",],
package_data={
"": ["py.typed"],
},
author="Chia Network, Inc.",
author_email="[email protected]",
url="https://github.com/Chia-Network/clvm",
Expand Down