Skip to content

Commit

Permalink
Revert "use PythonReturnType for as python return type"
Browse files Browse the repository at this point in the history
This reverts commit f806e68.
  • Loading branch information
altendky committed Mar 25, 2024
1 parent 8f7c410 commit 7a956fc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
6 changes: 3 additions & 3 deletions clvm/SExp.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import typing_extensions

from .as_python import PythonReturnType, as_python
from .as_python import as_python
from .CLVMObject import CLVMObject, CLVMStorage

from .EvalError import EvalError
Expand Down Expand Up @@ -196,7 +196,7 @@ def to(cls: typing.Type[_T_SExp], v: typing.Any) -> _T_SExp:
# this will lazily convert elements
return cls(to_sexp_type(v))

def cons(self: _T_SExp, right: CastableType) -> _T_SExp:
def cons(self: _T_SExp, right: _T_SExp) -> _T_SExp:
return self.to((self, right))

def first(self: _T_SExp) -> _T_SExp:
Expand Down Expand Up @@ -249,7 +249,7 @@ def list_len(self) -> int:
v = v.rest()
return size

def as_python(self) -> PythonReturnType:
def as_python(self) -> typing.Any:
return as_python(self)

def __str__(self) -> str:
Expand Down
6 changes: 2 additions & 4 deletions clvm/as_python.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,10 @@ def _as_python(op_stack: OpStackType, val_stack: ValStackType) -> None:
val_stack.append(t.atom) # type:ignore[arg-type]


def as_python(sexp: SExp) -> PythonReturnType:
def as_python(sexp: SExp) -> Any:
op_stack: OpStackType = [_as_python]
val_stack: ValStackType = [sexp]
while op_stack:
op_f = op_stack.pop()
op_f(op_stack, val_stack)
result = val_stack[-1]
assert not isinstance(result, SExp)
return result
return val_stack[-1]

0 comments on commit 7a956fc

Please sign in to comment.