Skip to content
Closed
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
4 changes: 3 additions & 1 deletion clvm/SExp.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@ def to_sexp_type(
return stack[0]


_T_SExp = typing.TypeVar("_T_SExp", bound="SExp")

class SExp:
"""
SExp provides higher level API on top of any object implementing the CLVM
Expand Down Expand Up @@ -173,7 +175,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